mysql故障:重启mysql后启动报错
昨天在试运行环境做系统升级,突然间SSH连接断开,尝试进行连接一直报错,后来重启我的电脑再次进行连接,依然报错,奇怪的测试人员访问公司的liferay界面可以正常访问,后来给部门同事打电话问他们今天有没有对试运行环境做过什么修改,两个同事都说是今天没有对试运行服务器做过任何操作,我自己也没有做过什么操作,后来跟机房的技术支持打电话咨询了一下,技术支持说机房今天也没有做什么操作更没有做什么限制,后来通过登录Xenserver来登录到试运行这台机器,发现没有异常,还特意看了一下SSH的连接数,查看log也没有发现异常,重启了一下SSH服务,依然连接不上,由于在做升级,情急之下,重启了试运行的物理机,但是查看mysql服务的状态时,报错如下:
[root@localhost mysql]# /etc/rc.d/init.d/mysql status MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED] 将/var/lock/subsys/mysql文件移动到/tmp下,启动mysql服务,报错如下 mv /var/lock/subsys/mysql /tmp [root@localhost mysql]# /etc/rc.d/init.d/mysql start Starting MySQL...The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid). [FAILED] 查看错误日志,发现关键信息: ‘/log/mysqlbinlog/mysql-bin.index‘ not found (Errcode: 13 - Permission denied) 150527 21:27:56 mysqld_safe mysqld from pid file /data_mysql/mysqldata/mysql.pid ended 150527 21:29:13 mysqld_safe Starting mysqld daemon with databases from /data_mysql/mysqldata /usr/local/mysql/bin/mysqld: File ‘/log/mysqlbinlog/mysql-bin.~rec~‘ not found (Errcode: 13 - Permission denied) 2015-05-27 21:29:15 2151 [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open register file. 2015-05-27 21:29:15 2151 [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the index file. 2015-05-27 21:29:15 2151 [ERROR] Aborting 原因:由于mysql和公司应用部署在同一台机器上,当时将mysqlbinlog目录移动到/log目录下,而/log是服务器日志的统一存放路径,连同其子目录属主和属组全是普通用户tomcat,查看/log/mysqlbinlog的属主和属组也是tomcat,呵呵,原来是权限的问题。 解决方法:修改mysqlbinlog目录和子目录的属主属组为mysql,然后启动mysql服务 chown -R mysql:mysql mysqlbinlog /etc/init.d/mysqld start
本文出自 “nagios故障” 博客,请务必保留此出处http://5250070.blog.51cto.com/5240070/1656123
文章来自:http://5250070.blog.51cto.com/5240070/1656123