当我尝试启动mysql
时,我收到以下错误:
170228 15:14:38 mysqld started
InnoDB: Error: log file ./ib_logfile2 is of different size 0 0 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
170228 15:14:38 Can't init databases
170228 15:14:38 Aborting
170228 15:14:38 InnoDB: Warning: shutting down a not properly started
InnoDB: or created database!
170228 15:14:38 /usr/local/mysql/bin/mysqld: Shutdown Complete
170228 15:14:38 mysqld ended
当我删除这个日志文件时,据我所知我应该这样做以便修复它,我得到了以下错误:
170228 15:21:39 mysqld started
170228 15:21:39 InnoDB: Log file ./ib_logfile2 did not exist: new to be created
170228 15:21:39 Can't init databases
170228 15:21:39 Aborting
170228 15:21:39 InnoDB: Warning: shutting down a not properly started
InnoDB: or created database!
170228 15:21:39 /usr/local/mysql/bin/mysqld: Shutdown Complete
170228 15:21:39 mysqld ended
之后我实际上返回原始情况,其中" ib_logfile2的大小为0 0字节"。
我该如何解决这个问题?
修改: 这是我的DB数据文件夹:
drwxr-xr-x 2 mysql mysql 132 Feb 27 15:38 forum_test
-rw-r--r-- 1 mysql mysql 10737418240 Feb 27 15:41 ibdata1
-rw-r--r-- 1 mysql mysql 10737418240 Feb 27 15:33 ibdata2
-rw-r--r-- 1 mysql mysql 10737418240 Feb 27 15:31 ibdata3
-rw-r--r-- 1 mysql mysql 10737418240 Feb 27 15:37 ibdata4
-rw-r--r-- 1 mysql mysql 10737418240 Feb 27 15:35 ibdata5
-rw-rw---- 1 mysql mysql 5242880 Feb 27 19:03 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Feb 27 16:20 ib_logfile1
-rw-rw---- 1 mysql mysql 0 Feb 28 15:21 ib_logfile2
-rw-r--r-- 1 mysql mysql 21076 Feb 27 18:58 my.cnf_abc
drwxr-xr-x 2 mysql mysql 4096 Feb 27 15:37 mysql
drwxr-xr-x 2 mysql mysql 102 Feb 27 15:39 test
drwxr-xr-x 2 mysql mysql 16384 Feb 27 15:39 abc
drwxr-xr-x 2 mysql mysql 4096 Feb 27 15:37 abcAdv
drwxr-xr-x 2 mysql mysql 36864 Feb 27 15:39 abcExcel
drwxr-xr-x 2 mysql mysql 81 Feb 27 15:37 abcHul
drwxr-xr-x 2 mysql mysql 4096 Feb 27 15:39 abcMesh
drwxr-xr-x 2 mysql mysql 4096 Feb 27 15:39 abcMilt
-rw-rw---- 1 mysql mysql 4603 Feb 28 15:21 abc-restore180.log
drwxr-xr-x 2 mysql mysql 4096 Feb 27 15:39 abcSold
drwxr-xr-x 2 mysql mysql 137 Feb 27 15:39 abcVod