数据库出现了点问题,然后想通过重新启动来释放一些资源,结果进程kill掉之后,启动不了了!
[root@twap mysql]#mysqld_safe --defaults-file=/etc/my.cnf
&
[root@twap mysql]#ps -ef|grep 8347
root 9197 7064 0 15:39
pts/3 00:00:00 grep 8347
[root@twap mysql]#
查看了下mysql启动日志:
120412 15:02:04 mysqld_safe Starting mysqld daemon with
databases from /var/lib/mysql
120412 15:02:05 [Note] Plugin 'FEDERATED' is disabled.
120412 15:02:05 InnoDB: The InnoDB memory heap is disabled
120412 15:02:05 InnoDB: Mutexes and rw_locks use InnoDB's own
implementation
120412 15:02:05 InnoDB: Compressed tables use zlib 1.2.3
120412 15:02:05 InnoDB: Using Linux native AIO
120412 15:02:05 InnoDB: Initializing buffer pool, size = 2.0G
120412 15:02:05 InnoDB: Completed initialization of buffer
pool
120412 15:02:05 InnoDB: highest supported file format is
Barracuda.
120412 15:02:05 InnoDB: Waiting for the
background threads to start
120412 15:02:06 InnoDB: 1.1.6 started; log sequence number
2353892702
/usr/sbin/mysqld: File '' not found (Errcode: 2)
120412 15:02:06 [ERROR] Failed to open log (file '', errno 2)
120412 15:02:06 [ERROR] Could not open log file
120412 15:02:06 [ERROR] Can't init tc log
120412 15:02:06 [ERROR] Aborting
120412 15:02:06 InnoDB: Starting
shutdown...
120412 15:02:08 InnoDB: Shutdown completed; log
sequence number 2353892702
120412 15:02:08 [Note] /usr/sbin/mysqld: Shutdown complete
错误很诡异,不知道为啥要打开名字为‘’的文件,于是尝试先注释掉my.cnf log-bin,
重新启动
[root@twap mysql]#mysqld_safe --defaults-file=/etc/my.cnf
&
[root@twap ~]# ps -ef|grep 8347
mysql 8905 8233 10 15:10
pts/0 00:03:29 /usr/sbin/mysqld --defaults-file=/etc/my.cnf
--basedir=/usr --datadir=/var/lib/mysql
--plugin-dir=/usr/lib/mysql/plugin --user=mysql
--log-error=/var/lib/mysql/twap.dzwww.com-A4-6-2-78.err
--open-files-limit=8192
--pid-file=/var/lib/mysql/twap.dzwww.com-A4-6-2-78.pid
--socket=/var/lib/mysql/mysql.sock --port=8347
root 9222 7064 0 15:43
pts/3 00:00:00 grep 8347
[root@twap ~]#
哦了!
不过log-bin=mysql-bin配置与主从配置有关,并且它记录了所有数据库的操作,用于灾难恢复,所以注释掉它也是有一定风险的,需要定时备份数据库!