错误信息
2016-07-01 9:37:56 2664 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-07-01 9:37:56 2664 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-01 9:37:56 2664 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-07-01 9:37:56 2664 [Note] InnoDB: Memory barrier is not used
2016-07-01 9:37:56 2664 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-01 9:37:57 2664 [Note] InnoDB: Not using CPU crc32 instructions
2016-07-01 9:37:57 2664 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2016-07-01 9:37:57 2664 [Note] InnoDB: Completed initialization of buffer pool
2016-07-01 9:37:57 2664 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-01 9:37:57 2664 [Note] InnoDB: The log sequence numbers 37077739 and 37077739 in ibdata files do not match the log sequence number 37077749 in the ib_logfiles!
2016-07-01 9:37:57 2664 [Note] InnoDB: Database was not shutdown normally!
2016-07-01 9:37:57 2664 [Note] InnoDB: Starting crash recovery.
2016-07-01 9:37:57 2664 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-07-01 9:38:11 2664 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace tp5/qii_menu uses space ID: 21 at filepath: .\tp5\qii_menu.ibd. Cannot open tablespace ymtx/az_brand which uses space ID: 21 at filepath: .\ymtx\az_brand.ibd
InnoDB: Error: could not open single-table tablespace file .\ymtx\az_brand.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
看最后一句,在my.ini里面设置innodb_force_recovery>0试试
innodb_force_recovery=1
重启mysql,搞定了。
but,问题又来了。
insert数据,没有问题。但是update,就不行了。
1036:table xx is read only.
打开日志一看。
innodb Started in read only mode
wtf.
翻到一篇帖子:
http://stackoverflow.com/questions/25394466/my-sql-error-1015-cant-lock-file-errno-165-table-is-read-only-innodb-en
把刚才加的那句配置,删掉,重启,ok。