• 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
  • Please beaware of a breaking change in the REST API on the current Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

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
Back
Top