问题

我在一个服务器上已经安装了RHEL 5.我可以安装Apache和PHP很好,但我在我的MySQL安装遇到了严重的麻烦.我试过以下:

yum install mysql-server mysql 

并没有得到任何错误或冲突.然后我试图用以下命令启动mysql:

chkconfig --levels 235 mysqld on
service mysqld start

并得到尝试启动MySQL守护程序时发生超时错误.

我查看了我的日志,看到此错误:

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

我不知道从哪里下车.

作为参考,我使用RHEL 5并安装了最新版本的PHP 5和Apache.



解决方法
  1. Uninstall mysql using yum remove mysql*

  2. Recursively delete /usr/bin/mysql and /var/lib/mysql

  3. Delete the file /etc/my.cnf.rmp

  4. Use ps -e to check the processes to make sure mysql isn't still running.

  5. Reboot server with reboot

  6. Run yum install mysql-server. This also seems to install the mysql client as a dependency.

  7. Give mysql ownership and group priveleges with:

    chown -R mysql /var/lib/mysql

    chgrp -R mysql /var/lib/mysql

  8. Use service mysqld start to start MySQL Daemon.




相关问题推荐