Plesk

Unable to start MySQL/MariaDB on Plesk server because of lack of RAM: mysqld dead but subsys locked

Symptoms

Cause

MySQL/MariaDB service failed because of lack of free memory and left the /var/lock/subsys/mysqld file behind.

Resolution

It is required to remove /var/lock/subsys/mysqld file, free up some memory, and start MySQL/MariaDB.

Note: Actions described below require administrative skills, in case you have any difficulties with it, reboot the server to fix the issue. Consider increasing the amount of RAM on the server in order to prevent such issues from happening in the future.

  1. Log in to the server via SSH.

  2. Remove /var/lock/subsys/mysqld file:

    # rm -f /var/lock/subsys/mysqld

  3. Check the amount of free memory with "free -m" command. In case there is more then 200M free, skip this step. In case the amount of free memory is low, kill processes that consume most of the memory. For example, stop the Apache temporarily:

    Debian/Ubuntu:

    # service apache2 stop

    CentOS/RHEL:

    # service httpd stop

  4. Start MySQL/MariaDB:

    Debian/Ubuntu:

    # service mysqld start

    CentOS/RHEL:

    # service mariadb start

  5. In case Apache is stopped on step 3, start it back:

    Debian/Ubuntu:

    # service apache2 start

    CentOS/RHEL:

    # service httpd start

Exit mobile version