Remote database connections in Plesk

I have problems connecting the database in Plesk.

I did the following:

  1. Completely reinstalled the system on VDS.

  2. Installed Plesk on the server.

  3. Made the configuration according to the instructions: NodeJS FTP deploy on shared hosting with Plesk and cPanel
    The FTP connection is stable. The site was placed without problems and worked.

  4. Using Plesk, I create a database for the hosted site, assign a user, and create a table in the created database:

  5. I am trying to establish a direct connection to the database in Wappler, having previously checked the connection to the server. I also check the connection to the database through the server action:

As far as I remember, not so long ago it was made that a direct connection can work via localhost, using the server connection details from the selected target. And for sure, the connection to the database via localhost always worked in the server actions.

Who can tell me what the problem is or where I went wrong?

I would be very grateful for any comments and recommendations.

You can’t use localhost for direct connection to a remote database.
Localhost can be used for server connect connections, as the server actions are executed on the remote target, where localhost works. For the database manager you need the remote host/url.

Thank @Teodor for your quick response.

In the post above, I showed that I tested localhost not only for a direct connection to the database, but also for a connection in the server actions. The connection is not working.

I also checked possible host options in the direct connection (site domain / server IP address):

The connection to the database does not work.

Well, it seems the remote connection details are wrong. Check this with your hosting provider.
Also, some hosting provider require you to enable remote connections, so check that as well.

I don’t use shared hosting. I use a VDS server. Ie, my hosting provider can not help with this issue, because all the parameters are set by me through the Plesk panel and the server administrator panel.

I checked all the details, they are correct. I also set the permission to connect to the database remotely from any computer.

What other possible reasons could there be?

The error says your connection details are wrong / connection is refused.

Some server providers have strict firewall settings. To disable firewall on Ubuntu:

ufw allow 80,443,3000,996,7946,4789,2377,3306/tcp; ufw allow 7946,4789,2377,3306/udp;

I found the reason.

It was necessary to specify a domain without www, http or https in the Wappler settings. Just the domain and that’s it:

I understand that for someone this may be obvious. Or someone could be lucky and he tried this option during the search. But obviously there will be those who will repeat my torment. Guys, I’ve tried everything. I got as deep into the server settings and the Plesk admin panel as possible. I spent a whole day off on all this. And if it wasn’t for an luck, I would have continued to suffer tomorrow. And maybe I wouldn’t have found a reason in principle.

Why am I writing this? If the Wappler expects a domain without any details in this field, make an autocorrect - when the user enters a domain with the http, https, or www details, the program automatically removes them. This can save users from wasting time and most importantly a crazy amount of nerve cells.

Have a nice weekend, everyone! :slightly_smiling_face:

1 Like