Applicable to:
- Plesk for Linux
Symptoms
-
MySQL server is not started during Plesk update. The following errors can be found in
/var/log/plesk/install/autoinstaller3.log
:CONFIG_TEXT: Failed to start mysql.service: Unit not found.
Trying to start service mysql... inactive
WARNING!
Some problems are found during start service mysql(see log file: /var/log/plesk/install/plesk_18.0.28_installation.log)
Continue...
Trying to start service mysql... inactive
Trying to establish test connection...ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) -
Checking
mysql
service status withsystemctl
utility results in:# systemctl status mariadb.service
Unit mariadb.service could not be found.
# systemctl status mysql.service
Unit mariadb.service could not be found.
# systemctl status mysqld.service
Unit mariadb.service could not be found. -
mysql
service can be started manually with the command:# service mysql start
-
SystemD-based OS is used.
Cause
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
-
Log in to Plesk server using SSH.
-
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 -
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
-
Remove broken symbolic link:
# rm -f /etc/systemd/system/mariadb.service
-
Reload
systemd
daemon:# systemctl daemon-reload
Comments
3 comments
@...
After following all the steps above I'm still getting this error:
Hi suzie rosen,
Do you have MariaDB service enabled? What is the output of the below commands (in that order one by one)?
systemctl daemon-reload
systemctl start mariadb
systemctl status -l mariadb
root@web12:~# systemctl daemon-reload
root@web12:~# systemctl start mariadb
Failed to start mariadb.service: Unit mariadb.service not found.
root@web12:~# systemctl status -l mariadb
● mariadb.service
Loaded: not-found (Reason: Unit mariadb.service not found.)
Active: failed (Result: exit-code) since Thu 2022-09-22 13:13:46 CEST; 2h 58min ago
Main PID: 105238 (code=exited, status=7)
Status: "MariaDB server is down"
Sep 22 13:13:44 web12.phpnet.org systemd[1]: Starting MariaDB 10.3.36 database server...
Sep 22 13:13:44 web12.phpnet.org mysqld[105238]: 2022-09-22 13:13:44 0 [Note] /usr/sbin/mysqld (mysqld 10.3.36-MariaDB-0+deb10u1) starting as process 105238 ...
Sep 22 13:13:46 web12.phpnet.org systemd[1]: mariadb.service: Main process exited, code=exited, status=7/NOTRUNNING
Sep 22 13:13:46 web12.phpnet.org systemd[1]: mariadb.service: Failed with result 'exit-code'.
Sep 22 13:13:46 web12.phpnet.org systemd[1]: Failed to start MariaDB 10.3.36 database server.
Please sign in to leave a comment.