欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

安装mysql 出现:Fatal error: Can't open and lock_MySQL

程序员文章站 2022-04-25 18:37:10
...
本来初始化配置是这样的:

scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

出现了

[root@localhost mysql-5.6.14]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

在日志中出现了如下错误:

Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

后来采用了下面的语句就可以了:

scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --ldata=/var/lib/mysql