兴高采烈的登陆机器测master HA,结果mysql竟然挂了。
那就重启吧
1 2 |
[root@testdb3 mysql]# mysql -uroot p ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) |
我裤子都脱了,结果他给我看这个:
1 2 |
[root@testdb3 mysql]# service mysql start Starting MySQL (Percona Server).The server quit without updating PID file (/var/run/mysqld/mysqld.pid).[FAILED] |
找了半天找到日志目录:/app/mysql/mysqld.log
1 2 3 4 5 6 |
2014-11-02 13:51:10 6223 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.19-67.0 started; log sequence number 566089844 ^G/usr/sbin/mysqld: File <strong>'./mysql-bin.000001' not found</strong> (Errcode: 2 - No such file or directory) 2014-11-02 13:51:10 6223 [ERROR] Failed to open log (file './mysql-bin.000001', errno 2) 2014-11-02 13:51:10 6223 [ERROR] Could not open log file 2014-11-02 13:51:10 6223 [ERROR] Can't init tc log 2014-11-02 13:51:10 6223 [ERROR] Aborting |
查找./mysql-bin.000001,发现这个文件不在mysql lib目录(/var/lib/mysql)下面。
1 2 3 4 5 |
[root@testdb3 mysql]# pwd /var/lib/mysql [root@testdb3 mysql]# ls mysql-relay-bin.202753 mysql-relay-bin.202755 RPM_UPGRADE_HISTORY mysql-relay-bin.202754 mysql-relay-bin.index RPM_UPGRADE_MARKER-LAST |
于是:
1 2 3 |
[root@testdb3 mysql]# mv /app/mysql/mysql-bin.index /app/mysql/mysql-bin.index.bak [root@testdb3 mysql]# service mysql start Starting MySQL (Percona Server)...[ OK ] |
参考:http://blog.csdn.net/lxpbs8851/article/details/8101462