- 论坛徽章:
- 0
|
下面是我的安装教程:
首先,去对应的网站下载最新版本的源码。为了保持系统目录分布的一致性,建议把他们解开到/usr/local/src 目录:
#cd /usr/local/src
#tar xvfz filename.tar.gz
先介绍MySQL的安装:
# cd /usr/locl/src/mysql-3.23.35
# ./configure --prefix=/usr/local/mysql
这样就把MySQL 的安装目录设置为 /usr/local/mysql ,然后运行make 来编译源代码,接下来就可以用 make install 来安装了。
安装完毕后,需要把MySQL 库加入系统,采用ldconfig 命令来实现:
#echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
#ldconfig -v | grep libmysqlclient
然后可以看到系统返回:
libmysqlclient.so.10 => libmysqlclient.so.10.0.0
让MySQL 在启动时自动运行:
#echo "/usr/local/mysql/bin/safe_mysqld > /dev/null &" >> /etc/rc.d/rc.local
接下来初始化数据库(切换到/usr/local/mysql 目录):
# ./bin/mysql_install_db
到这一步就报错了,如下:
Neither host 'localhost' nor 'localhost' could not be looked up with
/usr/local/mysql/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
我的主机名已经改成了'localhost',可还是保如上的错误,我又执行./bin/resolveip时有如下信息:
./bin/resolveip Ver 2.3, for pc-linux-gnu (i686)
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Get hostname based on IP-address or IP-address based on hostname.
Usage: ./bin/resolveip [OPTIONS] hostname or IP-address
-?, --help Displays this help and exits.
-I, --info Synonym for --help
-s, --silent Be more silent.
-V, --version Displays version information and exits.
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
silent FALSE
我就不知道该如何解决了,然后据说可以查看/etc/hosts文件,我看了看hosts文件的信息如下:
[root@wxn mysql]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
[root@wxn mysql]#
接下来我就不知道该怎么办了,请教一下!谢谢! |
|