• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx

  • We are developing a new feature in Plesk that will help you promote your websites or business on social media. We want to conduct a one-hour online UX test to present the prototype and collect feedback. If you are interested in the feature, please book a meeting via this link.
    Thank you in advance!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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