Plesk

MySQL/MariaDB service cannot be started during Plesk update: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket

Symptoms

Cause

MySQL or MariaDB service misconfiguration.

Symbolic link for mysql service in /etc/systemd/system/ directory points to non-existing file:

# ls -la /etc/systemd/system/mariadb.service
lrwxrwxrwx 1 root root 38 Jul 29 2016 mariadb.service -> /usr/lib/systemd/system/mysqld.service
# ls -la /usr/lib/systemd/system/mysqld.service
ls: cannot access /usr/lib/systemd/system/mysqld.service: No such file or directory

Resolution

  1. Log in to Plesk server using SSH.

  2. Make sure that service definition is installed in /usr/lib/systemd/system/mariadb.service.

    # ls -la /usr/lib/systemd/system/mariadb.service
    -rw-r--r-- 1 root root 1697 Aug 16 2018 /usr/lib/systemd/system/mariadb.service

  3. Make sure that there is no startup script for mysql service in /etc/init.d/ directory and remove if it exists:

    # rm -f /etc/init.d/mysql

  4. Remove broken symbolic link:

    # rm -f /etc/systemd/system/mariadb.service

  5. Reload systemd daemon:

    # systemctl daemon-reload

 

Exit mobile version