今天在做一台服务器的转站处理,发现里面有大量的mysql-bin.000xxx这种文件了,因为服务器暂时没用就把mysql停止了,然后我把所有的mysql-bin.000xxx文件全部删除,结果发现mysql无法启动了,下面小编就来给各位介绍问题解决办法.
在启动mysql时提示mysql启动了,查看系统事件日志如下:
Could not open log file
看不懂那个日志文件不能打开,于时到mysql的data目录下的一个xxxx-b59093774c.err错误文件,打开如下一如下一段代码:
- 141019 22:35:49 [Note] Plugin 'FEDERATED' is disabled.
- 141019 22:35:49 InnoDB: The InnoDB memory heap is disabled
- 141019 22:35:49 InnoDB: Mutexes and rw_locks use Windows interlocked functions
- 141019 22:35:49 InnoDB: Compressed tables use zlib 1.2.3
- 141019 22:35:49 InnoDB: Initializing buffer pool, size = 128.0M
- 141019 22:35:49 InnoDB: Completed initialization of buffer pool
- 141019 22:35:49 InnoDB: highest supported file format is Barracuda.
- 141019 22:35:50 InnoDB: Waiting for the background threads to start
- 141019 22:35:51 InnoDB: 1.1.8 started; log sequence number 22869842
- x:/vsr/mpyx/bin/mysqld: File './mysql-bin.000574' not found (Errcode: 2)
- 141019 22:35:51 [ERROR] Failed to open log (file './mysql-bin.000574', errno 2)
- 141019 22:35:51 [ERROR] Could not open log file
- 141019 22:35:51 [ERROR] Can't init tc log
- 141019 22:35:51 [ERROR] Aborting
- //Vevb.com
- 141019 22:35:51 InnoDB: Starting shutdown...
- 141019 22:35:51 InnoDB: Shutdown completed; log sequence number 22869842
- 141019 22:35:51 [Note] x:/vsr/mpyx/bin/mysqld: Shutdown complete
注意我个看发其中有一个:
x:/vsr/mpyx/bin/mysqld: File './mysql-bin.000574' not found (Errcode: 2)
141019 22:35:51 [ERROR] Failed to open log (file './mysql-bin.000574', errno 2)
代码,意思是批/mysql-bin.000574文件不存在了,现在解决好了,我刚删除的文件在恢复站直接恢复/mysql-bin.000574文件再启动发现mysql启动正常了.
总结:mysql如果有大量的二进制日志文件我们删除时一定要注意,保留id为最大的那一个不要删除或直接在my.inik 中关闭mysql二进制日志生成即可解决此问题.
新闻热点
疑难解答