Applicable to:
- Plesk for Linux
Symptoms
-
Remote connection to MySQL/MariaDB database hosted on Plesk fails with the error:
# ERROR 2003 (HY000): Can't connect to MySQL server on '<Plesk server Ip Address>'
-
The option Allow local MySQL server to accept external connections is enabled in Plesk > Tools & Settings > Database Servers > click MySQL (MariaDB).
Cause
MySQL/MariaDB misconfiguration. There is another configuration file at /etc/mysql/
folder where the localhost
address is set at the bind-address
parameter of the MySQL server configuration MySQL service.
Resolution
-
Connect to the server via SSH.
-
Find the config file where
bind-address
is set to the127.0.0.1
# grep -R 'bind-address' /etc/mysql/* /etc/my.cnf
/etc/mysql/mariadb.conf.d/example.cnf:bind-address = 127.0.0.1 -
Comment or remove the line at the configuration file where the
bind-address
parameter is set to thelocalhost
address(or remove this line completely), it should look like below:# grep bind-address /etc/mysql/mariadb.conf.d/example.cnf
#bind-address = 127.0.0.1
Comments
0 comments
Please sign in to leave a comment.