MYSQL启动失败,提示Can’t find file: ‘./mysql/host.frm’解决办法
虚拟机默认启动Mysql,发现没有启动得了,于是,看了下Mysql的启动日志,如下:
110315 10:17:51  InnoDB: Started; log sequence number 0 43655
110315 10:17:51 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
110315 10:17:51 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
110315 10:17:51 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
110315 10:17:51  mysqld ended

解决办法:

这主要是没有权限读取,给个权限就OK了
1: 初始化数据库做了没有?
/usr/local/mysql/bin/mysqld_install_db –user=mysql
2:权限问题
chown -R root.mysql /usr/local/mysql/
chown -R mysql /usr/local.mysql/var/

调整lib库路径:

echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf

重新加载配置

ldconfig

启动mysql

/usr/local/mysql/bin/mysql_safe --user=mysql &

查看是否启动了

netstat -ntpl | grep 3306

转自 https://blog.51cto.com/06071124/609995