MySQL Daemon Lock问题 [英] MySQL Daemon Lock issue
问题描述
昨晚,我的MySQL服务器意外关闭.尝试重新启动时(使用service mysql restart
-我是root),它只是挂起.使用mysql -u root -p
命令,我得到:
Last night, my MySQL server went down unexpectedly. On attempting to restart (with service mysql restart
- I'm root) it merely hangs. With the mysql -u root -p
command, I get:
错误2002(HY000):无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
然后我尝试手动启动守护程序(mysqld
).提示将挂起大约2秒钟,然后返回.在仔细检查错误日志时,我得到:
I then tried to start the daemon manually (mysqld
). The prompt would hang for about 2 seconds, and then return. On closer inspection of the error logs, I got:
2016-01-22T19:18:32.399584Z 0 [ERROR] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2016-01-22T19:18:32.399622Z 0 [ERROR] Unable to setup unix socket lock file.
2016-01-22T19:18:32.399646Z 0 [ERROR] Aborting
然后我尝试了chown mysql /var/run/mysqld
,chmod -R 775 /var/run/mysqld
和apt-get install mysql-community-server --reinstall
.没有运气.
I then tried chown mysql /var/run/mysqld
, chmod -R 775 /var/run/mysqld
and apt-get install mysql-community-server --reinstall
. No luck.
我环顾四周,找不到解决方案.这里有帮助吗?
I have looked around, and couldn't find a solution. Any help here?
注意:我正在使用MySQL社区Server 5.7.10运行Debian 8(Jessie)
Note: I am Running Debian 8 (Jessie) with MySQL community Server 5.7.10
推荐答案
已修复.在[mysqld]
部分下将skip-external-locking
添加到my.cnf
,然后重新引导整个系统.对于任何发现此问题的人,这应该可以解决.同样,如果您备份了数据,然后尝试还原并被告知rm ib*
使其起作用,则需要ibdata
文件.
Fixed. Add skip-external-locking
to my.cnf
under the [mysqld]
section, and then reboot the entire system. This should fix it, for anyone who finds this. Also if you backed up your data, then attempted to restore and were told to rm ib*
to make it work, you need the ibdata
file.
这篇关于MySQL Daemon Lock问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!