my.cnf更改目录出现错误/usr/sbin/mysqld: Can’t find file: ‘./mysql/server_cost.frm’ (errno: 13 – Permission denied)
2017-11-23T03:19:21.171745Z 0 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/server_cost.frm’ (errno: 13 – Permission denied)
2017-11-23T03:19:21.171757Z 0 [Warning] Failed to open optimizer cost constant tables
2017-11-23T03:19:21.171855Z 0 [ERROR] /usr/sbin/mysqld: Can’t find file: ‘./mysql/user.frm’ (errno: 13 – Permission denied)
2017-11-23T03:19:21.171863Z 0 [ERROR] Fatal error: Can’t open and lock privilege tables: Can’t find file: ‘./mysql/user.frm’ (errno: 13 – Permission denied)
解决办法:
这主要是没有权限读取,给个权限就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