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 & 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 ;的目的是什么cd /usr ; ? 另外, &的目的是什么?
我尝试使用mysql-test-run.pl来testingMySQL守护进程,但是我似乎没有/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]#
通常这些警告与编译的二进制兼容性和您安装的C库有关。 CentOS 6.X有一个新的C库版本,可能会导致一些特定的软件版本,如MySQL 5.1.69一些警告。
mysql安装程序为你生成一个名为mysql.server的初始化脚本,基本上你必须做的是(确保你使用的是正确的二进制文件而不是安装源代码):
sudo cp support-files / 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脚本,你会看到脚本负责将正确的parameter passing给mysql_safe脚本来pipe理你的mysql数据库服务。 这些参数当然可以从my.cnfconfiguration文件读取或使用命令行。 另外,如果你有遵循mysql安装的build议,那么在使用之前你应该可以启动服务: /etc/init.d/mysqld {start|stop|restart}
对于这一个,你只需要检查mysql的安装path。 如果你从mysql-XXXXX.tar.gz文件编译mysql,那么你将能够在mysql安装path目录mysql-test上find脚本。 如果使用yum进行安装,则通常在/usr/bin/mysqltest尝试使用mysqltest命令