Sometimes we may want to configure MySQL with external connections so that other applications or servers can connect to our server through port 3306. At Clouding, the MySQL settings in Plesk are configured to allow only local connections for security reasons. However, you can easily enable external connections if needed.
Configure MySQL in Plesk
First, log in to Plesk and go to Tools & Settings > Database Servers > Settings, then select the option “Allow remote connections from any host“:
Next, go to Domains and click on the domain that has the configured database. Then go to Databases > Database Users and click on the user with permissions to manage the database. Make sure that the user also has the option “Allow remote connections from any host” selected:
Server configuration
The next step is to modify a server parameter called bind-address, for which you must edit the MySQL configuration file:
# vi /etc/mysql/my.cnf
Replace bind-address = ::ffff:127.0.0.1 with:
bind-address = 0.0.0.0
Important
The bind-address directive can also be defined in /etc/mysql/mariadb.conf.d/50-server.cnf. If so, make sure it points to 0.0.0.0 instead of the loopback address.
Then restart the service:
# systemctl restart mysql
Clouding Firewall configuration
Finally, you must open the port in the Clouding Firewall. Log in to the Clouding Panel, go to the server’s Firewall tab, and add a new rule. In the Source IP field, you can enter the IP of the machine that will connect. By setting 0.0.0.0/0, you allow anyone to connect using port 3306:
If you have any questions that are not fully answered in this article, remember that you can always contact support.