- Plesk for Linux
Remote connection to MySQL 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).
MySQL 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
Connect to the server via SSH.
Find the config file where
bind-addressis set to the
# 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-addressparameter is set to the
localhostaddress(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