致命错误:无法打开和锁定特权表:表'mysql.host'不存在 [英] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
问题描述
我位于在RHEL 5上重新安装的服务器上.我能够很好地安装Apache和PHP.但是,我在安装MySQL时遇到了严重麻烦.我尝试了以下方法:
I am on a server that has afresh install on RHEL 5. I was able to install Apache and PHP just fine., but I am having serious trouble with my MySQL installation. I tried the following:
yum install mysql-server mysql
并且没有任何错误或冲突.然后,我尝试使用以下命令启动mysql:
And didn't get any errors or conflicts. Then I tried to start mysql with the following commands:
chkconfig --levels 235 mysqld on
service mysqld start
并获取Timeout error occurred trying to start MySQL Daemon.
我检查了日志,并看到此错误:
I checked my logs and see this error:
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
我不确定从这里去哪里.
I'm not sure where to go from here.
作为参考,我正在使用RHEL 5,并安装了最新版本的PHP 5和Apache.
For reference I am using RHEL 5 and installed the latest versions of PHP 5 and Apache.
推荐答案
-
使用
yum remove mysql*
递归删除/usr/bin/mysql
和/var/lib/mysql
删除文件/etc/my.cnf.rmp
使用ps -e
检查进程以确保mysql仍未运行.
Use ps -e
to check the processes to make sure mysql isn't still running.
使用reboot
运行yum install mysql-server
.这似乎也将mysql客户端安装为依赖项.
Run yum install mysql-server
. This also seems to install the mysql client as a dependency.
赋予mysql所有权和组特权:
Give mysql ownership and group priveleges with:
chown -R mysql /var/lib/mysql
chgrp -R mysql /var/lib/mysql
使用service mysqld start
启动MySQL Daemon.
Use service mysqld start
to start MySQL Daemon.
这篇关于致命错误:无法打开和锁定特权表:表'mysql.host'不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!