排除mysql启动时的错误
时间:2010-09-06 来源:kennychang05
今天发现服务器上MYSQL不知什么原因停止运行了,立马登陆后重新启动看看,输入如下命令:
#/usr/local/mysql/share/mysql/mysql.server status
先看一下运行状态,显示为:
ERROR! MySQL is not running, but lock exists
#/usr/local/mysql/share/mysql/mysql.server start
启动mysql,显示:
Starting MySQL...... ERROR! Manager of pid-file quit without updating file.
出现错误,启动失败!
去“/usr/local/mysql/var/”下查看错误日志:
100826 10:44:02 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
100826 10:44:02 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
100826 10:44:02 [Note] Plugin 'FEDERATED' is disabled.
100826 10:44:02 [Note] Plugin 'ndbcluster' is disabled.
100826 10:44:02 InnoDB: Started; log sequence number 0 44233
/usr/local/mysql/libexec/mysqld: File './mysql-bin.000003' not found (Errcode: 13)
100826 10:44:02 [ERROR] Failed to open log (file './mysql-bin.000003', errno 13)
100826 10:44:02 [ERROR] Could not open log file
100826 10:44:02 [ERROR] Can't init tc log
100826 10:44:02 [ERROR] Aborting
100826 10:44:02 InnoDB: Starting shutdown...
100826 10:44:07 InnoDB: Shutdown completed; log sequence number 0 44233
100826 10:44:07 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
100826 10:44:07 mysqld_safe mysqld from pid file /usr/local/mysql/var/figweb.pid ended
错误提示“Failed to open log (file './mysql-bin.000003', errno 13)” 不能打开日志文件“mysql-bin.000003”估计是权限问题
输入命令授于权限:
#chmod -r 755 /usr/local/mysql/var/mysql-bin.000003
重新启动mysql
#/usr/local/mysql/share/mysql/mysql.server start
Starting MySQL. SUCCESS!
启动成功!
如果不行,还可以有一种解决办法。那就是关闭二进制日志功能。
方法:
使用vi编辑器打开/etc/my.cnf文件,找到log-bin=mysql-bin将其加上注释即可。修改后为:#log-bin=mysql-bin;
启动mysql即可!这是一种迫不得已的办法