mysql host存在还报错,致命错误:无法打开和锁定特权表:表'mysql.host'不存在

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

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

And get 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.

For reference I am using RHEL 5 and installed the latest versions of PHP 5 and Apache.

解决方案

Uninstall mysql using yum remove mysql*

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

Delete the file /etc/my.cnf.rmp

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

Reboot server with reboot

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

Give mysql ownership and group priveleges with:

chown -R mysql /var/lib/mysql

chgrp -R mysql /var/lib/mysql

Use service mysqld start to start MySQL Daemon.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值