Symptoms
-
When accessing a MySQL/MariaDB server/database in Plesk from a remote machine, one of the following error messages appears:
SQLSTATE[HY000] [2002] Connection refused
Lost connection to MySQL server at 'reading initial communication packet', system error:61
Fatal error: Uncaught mysqli_sql_exception: Connection refused
Cause
MySQL/MariaDB is configured to listen on localhost address only.
Resolution
Configure a remote MySQL/MariaDB access according to this KB article.