• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question Change default Mysql/Mariadb port - backup issue

JVG

Basic Pleskian
Server operating system version
Debian 12.5
Plesk version and microupdate number
18.0.61.5
Product version: Plesk Obsidian 18.0.61.5
OS version: Debian 12.5 x86_64
mariadb Ver 15.1 Distrib 10.11.6-MariaDB

Hi,

I needed remote access to a subscription database, I follow a couple of docs and everything worked fine.

Now I figured to change the default Mariadb port (my first time doing so), so I added to /etc/mysql/mariadb.conf.d/50-server.cnf under mysqld:
port = newport

I restarted the service, added such port to the firewall and again, everything worked fine and now I have remote access through that port.

The problem is that now I can't backup the database through Plesk. When I try to do so I get this error:
Code:
Unable to make database dump. Error: Failed to exec mysqldump: Exit code: 2: mysqldump: Got error: 2002: "Can't connect to server on 'localhost' (111)" when trying to connect

Is there something in the Plesk configuration files that I need to change? or in some other mysql/mariadb file?

Also in the Tools & Settings > Database Servers section it still shows the port 3306 for MariaDb at localhost, even though I've tested to connect to the new port and it works.

Again, is my first time changing the default port on a Plesk server so any guidance would be appreciated.
 
Now I figured to change the default Mariadb port (my first time doing so), so I added to /etc/mysql/mariadb.conf.d/50-server.cnf under mysqld:
port = newport
Just for my own understanding, did you change the port of MariaDB on the remote database server? Or on the Plesk server?
 
Just for my own understanding, did you change the port of MariaDB on the remote database server? Or on the Plesk server?
Hi,

the Plesk server is where the database is, I needed access to it from my local machine.

I changed it on the plesk server by adding the new port to the /etc/mysql/mariadb.conf.d/50-server.cnf file under mysqld.

This worked because now I can access the database hosted at Plesk through that new port from my local enviroment.

But Plesk can't backup the database and it shows the error mentioned above.
 
Got it, thank you for clarifying.

I am not sure if Plesk supports running MariaDB on a different port. However I submitted a bug report about this, as all other aspects of Plesk seem to work fine. Unfortunately I don't have any suggestion how to solve the issue.

What you can try als a workaround is to exclude databases from the backups and create a bash script that uses the Plesk CLI to make seprate database dumps. An explanation on how to use the Plesk CLI to make database dumps can be found here: https://support.plesk.com/hc/en-us/...a-a-command-line-interface-in-Plesk-for-Linux
 
  • Like
Reactions: JVG
I just got confirmation for our engineers that running Plesk on a different port isn't (officially) supported.
 
  • Like
Reactions: JVG
I've had a problem with this error for 3 years now... it even survived upgrading from CentOS 7 to AlmaLinux 8 using the upgrade tool Plesk provided.
I get a list of errors from Plesk backup every day listing all the domains I host and this error:

Unable to make database dump. Error: Failed to exec mariadb-dump: Exit code: 2: mariadb-dump: Got error: 2002: "Can't connect to server on 'localhost' (111)" when trying to connect

I got desperate and tried something new: I worked with Grok on this problem on my server, and after hours of troubleshooting we found a solution/workaround:

This is the solution we came up with.

I'm not sure if this is a Plesk bug or if they can fix this, but this solution fixes it for me.
If it is something that can be turned in to the devs, or if one is watching, let me know.
 
Sorry... I think I accidentally posted my reply in the wrong thread. Apologies if it is irrelevant.
 
Back
Top