MySQL 初始安装后,守护进程首次启动时会返回如下所示的消息。我试图更好地理解此消息,并有以下问题:
是什么原因导致有关无法使用 resolveip 查找主机的警告?这是全新安装的 Centos 6.4,因此
yum install mysql mysql-server
。MySQL 服务器版本是 5.1.69 源发行版。为什么这么说
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
?我以为我想让chkconfig --levels 235 mysqld on
MySQL 在启动时启动。为什么会这样说
You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe &
。我以为我想使用service mysqld start
或。和/etc/init.d/mysqld start
之间有什么不同? 的目的是什么?此外, 的目的是什么?mysqld
mysqld_safe
cd /usr ;
&
我尝试使用 测试 MySQL 守护进程
mysql-test-run.pl
,但似乎没有/usr/mysql-test
。有什么想法吗?
谢谢
[root@localhost Michael]# service mysqld start
Initializing MySQL database: WARNING: The host 'localhost.mysite.com' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.mysite.com password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
[root@localhost Michael]#
答案1
通常这些警告与编译的二进制文件兼容性和您安装的 C 库有关。CentOS 6.X 附带了一个新的 C 库版本,这可能会对特定软件版本(如 mysql 5.1.69)产生一些警告。
mysql 安装程序为您生成一个名为 mysql.server 的初始化脚本,基本上您需要做的是(确保您使用的是正确的二进制文件而不是安装源代码):
sudo cp 支持文件/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --add mysql
chkconfig --levels 235 mysql
该
/usr/bin/mysqld_safe &
脚本是运行 mysql 服务器的脚本。如果您查看 mysql init 脚本,您将看到该脚本负责将正确的参数传递给 mysql_safe 脚本来管理您的 mysql 数据库服务。这些参数当然可以从 my.cnf 配置文件或使用命令行读取。此外,如果您遵循了 mysql 安装建议,此时您应该能够按照之前提到的方式启动服务:/etc/init.d/mysqld {start|stop|restart}
对于这个,你只需要检查 mysql 安装路径。如果你从
mysql-XXXXX.tar.gz
文件编译了 mysql,那么你将能够在 mysql 安装路径目录 mysql-test 上找到脚本。如果使用 yum 安装,则尝试使用 mysqltest 命令,通常在/usr/bin/mysqltest