当使用 alter table 向超过 20m 行的表添加索引时,一段时间后我与 mysql 断开连接。 我使用的是 mysql 5.6,这是我得到的日志文件:
END OF INNODB MONITOR OUTPUT
============================
InnoDB: ###### Diagnostic info printed to the standard error stream
InnoDB: Error: semaphore wait has lasted > 600 seconds
InnoDB: We intentionally crash the server, because it appears to be hung.
2014-08-31 21:52:17 890 InnoDB: Assertion failure in thread 2192 in file srv0srv.cc line 1748
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
最佳答案
我通过更改 cfg 文件“my”修复了这个问题。 我将 inno db 缓冲区更改为 1500mb,现在一切都很好。
希望对其他人有帮助。
关于Mysql添加索引导致超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25596107/