MySQL Daemon Lock issue

后端 未结 10 939
清酒与你
清酒与你 2020-12-09 07:53

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 r

相关标签:
10条回答
  • 2020-12-09 08:36

    It's best to look at the log files (/usr/local/var/mysql/*.local.err) before attempting any of the more generic answers.


    In my case first it complained of not being able to open the socket file ([Server] Could not open unix socket lock file /tmp/mysql.sock.lock.) and once I changed permissions, it complained of not being able to remove it! ([Server] Could not remove unix socket lock file /tmp/mysql.sock.lock errno 13.)

    Removed it and run mysql.server start and DONE.

    0 讨论(0)
  • 2020-12-09 08:43

    I experienced the same issue today on my Ubuntu server. But I think the solution is NOT to disable locking. In my case, a look at the system log (dmesg | tail and journalctl -xe) revealed that it's an apparmor issue and the solution can be found in this question.

    0 讨论(0)
  • 2020-12-09 08:48

    Rename /var/lib/mysql/mysql.sock.lock & /var/lib/mysql/mysql.sock to /var/lib/mysql/mysql.sock.lock.bck & /var/lib/mysql/mysql.sock.bck respectively and start mysqld. It works

    0 讨论(0)
  • 2020-12-09 08:48

    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.

    0 讨论(0)
提交回复
热议问题