MySQL Daemon Lock issue

后端 未结 10 938
清酒与你
清酒与你 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:21

    Posting this answer, in case it helps someone with the same config as me. I had similar issue with this configuration:

    Host OS: Ubuntu 20.04, MySql server: 8.0

    The following error was seen in /var/log/mysql/error.log during run of systemctl start mysql

    [ERROR] [MY-010273] [Server] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
    

    Fix was similar:

    mkdir -p /var/run/mysqld/
    chmod 777 /var/run/mysqld/
    

    And of course, I had enough space wherever mysql server was being installed.

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

    Below commands worked for me.

    sudo mkdir /var/run/mysqld
    
    sudo chmod 777 /var/run/mysqld -R
    
    0 讨论(0)
  • 2020-12-09 08:26

    I just ran into this. The mysql install was a little weird and was missing /var/run/mysqld/

    MySQLd was attempting to create the socket and lock file but the parent directory was missing. I simply created the directory

    sudo mkdir /var/run/mysqld
    

    chowned it to mysql

    sudo chown mysql:mysql /var/run/mysqld
    

    I was then able to start mysqld normally.

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

    Also may be out of disk space.

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

    I had following error

    [ERROR] Unix socket lock file is empty /var/lib/mysql/mysql.sock.lock.
    

    This error came up as a result that my server was lacking space 100% use (see below)

    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/xvda1      41153856 28531384  12187364  100% /
    

    Make sure the folder exists with the proper permissions

    chown mysql:mysql /var/lib/mysql/
    

    And make sure to delete the file so the mysql server could generate a new one

    rm /var/lib/mysql/mysql.sock.lock
    
    0 讨论(0)
  • 2020-12-09 08:33

    If you are using docker to run MySQL, please check if there is enough allocated disk space in docker preferences.

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