在linux运行中出项mysql起动报错The server quit without updating PID file (/usr/local/mysql/data/

在百度上查了好多,试了下都没有用,可能情况不同。我的mysql版本是mysql5.6.40

我的方法是

重新配置my.cnf

vi /etc/my.cnf 


#在[mysqld]中添加:

datadir = /usr/local/mysql/data

log-error = /usr/local/mysql/data/error.log

pid-file = /usr/local/mysql/data/mysql.pid

user = mysql

tmpdir = /tmp

#保存退出


然后再初始化数据库:

在mysql目录下的scripts目录中:

./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysql.pid --tmpdir=/tmp


我的效果:

[root@mini1 scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysql.pid --tmpdir=/tmp


然后重启mysql

service mysqld restart 

成功

转载自http://blog.51cto.com/rabbit2013/1341055

你可能感兴趣的:(在linux运行中出项mysql起动报错The server quit without updating PID file (/usr/local/mysql/data/)