• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Cannot connect to database remote

Timo002

Basic Pleskian
Hello,

I want to connect to a database remotely. So on the Database User page, I set 'Access control' to "Allow remote connections from any host".

But I can't connect to the database, it keeps rejecting mee. The firewall allows Mysql connections.

I don't know what else to check, other Plesk installations I have running are working fine with remote access.

OS: ‪CentOS Linux 7.1.1503 (Core)‬
Plesk version: 12.5.30 Update #48, last updated at Oct 10, 2016 03:40 PM
 
Three suggestions:

- In /etc/my.cnf: What does the line "bind-address" say? It should read
bind-address = ::
Restart the service after setting this default.

- The firewall may allow MySQL connections, but fail2ban may have blocked your remote host temporarily. Check if its IP address is listed and if so, whitelist it.

- On your remote host, check that the name of the database server (your Plesk host) is spelled correctly and resolves to the IP address of your Plesk host. Your software might not even connect to the correct host.
 
@Peter Debik

/etc/my.cnf didn't had a line "bind-address". So I added. Restarted mariaDB with
$ systemctl restart mariadb
But still can't connect.
I also tried 'bind-address=*' and 'bind-address=xxx.xxx.xxx.xxx' where xxx is the server IP

Concerning fail2ban, I believe it is not installed because the folder `/etc/fail2ban` does not exist.

I'm using the IP address that Plesk shows me under the "system overview" on the "home" page.

I use sequal pro to connect, but I'm getting directly an error:
Code:
Unable to connect to host xxx.xxx.xxx.xxx, or the request timed out.

Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).

MySQL said: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (61)
 
Oke, I got it working and it seemed to be the firewall.

When I checked the firewall in Plesk "Tools & Settings > Firewall", it shows this:
upload_2016-10-11_6-40-20.png

But I manually added a rule for port 3306:
upload_2016-10-11_6-41-37.png

Now it is working fine!
 
I supposed that the default firewall rules where enough, because on other VPS's I'm running with Plesk, I didn't had to change a thing for this. And because of the firewall rule "MySQL server", I supposed this port was open.
 
Back
Top