The error “ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): Connection refused” is one that appears on the Plesk login page if the MySQL service isn’t running when you go to the Plesk login page.
First, attempt to restart MySQL on your server:
- Log into your server using SSH
- Enter this command:
service mysqld restart
- Your MySQL service should restart
However, this often does not work. The MySQL service needs to create a file in order to run, but it cannot create the file because a duplicate file of the same name exists.
To fix this problem:
- Log into your server using SSH
- Enter this command to rename the duplicate file:
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
- Then enter this command:
service mysqld restart
- Your MySQL service will restart, and the Plesk error should be fixed