码迷,mamicode.com
首页 > 数据库 > 详细

mysql启动错误

时间:2018-01-30 16:51:28      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:ace   should   and   add   ted   注释   var   etc   create   

service mysql start时报:ERROR! The server quit without updating PID file (/usr/local/mysql/data/mysql1.pid),错误。

1、查看error日志:

Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

发现是由于my.cnf这个文件配置错误导致的。

2、vim /etc/my.cnf

增加:

innodb_data_file_path=ibdata1:12M;ibdata2:10M:autoextend

参数要与已有的表空间一致,也就是/usr/local/mysql/data/目录下的文件size一致。或者直接删除掉ibdata1  ib_logfile0  ib_logfile1这三个文件也可。

再启动,发现还是报这个错误。确认是由于my.cnf文件配置错误造成的。

修改my.cnf文件:

注释:

#pid-file=/var/run/mysqld/mysqld.pid

#socket=/var/lib/mysql/mysql.sock

这两行注释掉。

再启动,即可成功。

mysql启动错误

标签:ace   should   and   add   ted   注释   var   etc   create   

原文地址:https://www.cnblogs.com/magmell/p/8384525.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!