本文共 671 字,大约阅读时间需要 2 分钟。
mysql 安装时候安装后启动不成功报错:
Starting MySQL.. ERROR! The server quit without updating PID file (/data/mysql/26765574162f.pid).
查看报错日志:
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
解决办法:
1.编辑配置文件:
1 | vim /etc/my .cnf |
1 2 3 4 5 6 7 | basedir = /usr/local/mysql datadir = /data/mysql socket = /tmp/mysql .sock log-error = /data/mysql/error .log pid- file = /data/mysql/mysql .pid user = mysql tmpdir = /tmp |
2.重新初始化mysql:
1 | . /mysql_install_db --user=mysql --basedir= /usr/local/mysql --datadir= /data/mysql --pid- file = /data/mysql/mysql .pid --tmpdir= /tmp |
然后再启动就会成功了:
转载地址:http://uhlia.baihongyu.com/