之前运行mysql的时候好好的,今天建索引的时候出现一系列的warning:
InnoDB: Warning: a long semaphore wait
接着出现错误:
随后服务自动关闭,网上资料说是因为哈希自适应索引的问题,mysql的哈希自适应索引是默认开启的,这样建立索引后,读取和写入的效率能提高2倍以上,但是有可能会出现死锁的问题,网上建议关闭Error: semaphore wait has lasted > 600 seconds
innodb_adaptive_hash_index具体过程:
mysql -u root -t;
set global innodb_adaptive_hash_index=off;
查看修改结果 SHOW GLOBAL VARIABLES LIKE 'innodb_ada%';可以看到innodb_adaptive_hash_index已经关闭,完成。
参考资料:
https://bugs.mysql.com/bug.php?id=50641
http://stackoverflow.com/questions/24860111/warning-a-long-semaphore-wait