mysql禁用日志后无法启动问题怎么解

发布时间:2020-04-16编辑:脚本学堂
本文介绍了mysql禁用日志后,mysql无法启动问题的解决方法,有需要的朋友参考下。

mysql/ target=_blank class=infotextkey>mysql数据库启动不了,查看错误日志:
/usr/sbin/mysqld: File './mysql-bin.000003' not found (Errcode: 2)
140319 10:49:22 [ERROR] Failed to open log (file './mysql-bin.000003', errno 2)
140319 10:49:22 [ERROR] Could not open log file
140319 10:49:22 [ERROR] Can't init tc log
140319 10:49:22 [ERROR] Aborting

140319 10:49:22  innodb: Starting shutdown...
140319 10:49:27  InnoDB: Shutdown completed; log sequence number 0 2154633517
140319 10:49:27 [Note] /usr/sbin/mysqld: Shutdown complete

140319 10:49:27 mysqld_safe mysqld from pid file /var/lib/mysql/richinfo-dev2.pid ended
140319 10:59:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140319 10:59:48 [Note] Plugin 'FEDERATED' is disabled.
140319 10:59:48  InnoDB: Initializing buffer pool, size = 256.0M
140319 10:59:48  InnoDB: Completed initialization of buffer pool
140319 10:59:48  InnoDB: Started; log sequence number 0 2154633517
/usr/sbin/mysqld: File './mysql-bin.000003' not found (Errcode: 2)
140319 10:59:48 [ERROR] Failed to open log (file './mysql-bin.000003', errno 2)
140319 10:59:48 [ERROR] Could not open log file
140319 10:59:48 [ERROR] Can't init tc log
140319 10:59:48 [ERROR] Aborting

140319 10:59:48  InnoDB: Starting shutdown...
140319 10:59:54  InnoDB: Shutdown completed; log sequence number 0 2154633517
140319 10:59:54 [Note] /usr/sbin/mysqld: Shutdown complete

140319 10:59:54 mysqld_safe mysqld from pid file /var/lib/mysql/richinfo-dev2.pid ended

显示找不到日志文件/mysql-bin.000003,在linux操作系统查看该文件确实不存在,继续查看mysql启动参数文件/etc/my.cnf
#log-bin=mysql-bin
原来是mysql数据库禁用了日志功能,可能是mysql-bin.index文件没有删除导致的,在系统中查看该文件确实存在,将其删除后,再次启动数据库,数据库能正常启动了。