• 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
  • 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.

Question How to use Mysql instead of the default MariaDB?

sweetman

Basic Pleskian
Server operating system version
CentOS 7.9
Plesk version and microupdate number
Plesk Obsidian 18.0.44 update #3
Hello all,
I'm not a Plesk guru (I use it occasionally, when someone ask me to get something on his server).
In this case, I'm asked to use Mysql instead of the default MariaDB.
Is there a way to set MySQL as the default DB server?
TIA
tony
 
Plesk can run with MariaDB or MySQL. Most OSes supported by Plesk ship with MariaDB as the default database service. If your server comes with Plesk pre-installed then it's quite a challenge to switch from MariaDB to MySQL (or the other way around). A similar situation has been discussed in this topic: Question - Switch from Mysql to MariaDB
 
In CentOS 7, MariaDB is the Database by default.

I would not recommend to replace MariaDB with MySQL in CentOS 7.

Better option would be to run a MySQL Docker. You can add this MySQL Docker as a Database Server to the Plesk.
 
In CentOS 7, MariaDB is the Database by default.

I would not recommend to replace MariaDB with MySQL in CentOS 7.

Better option would be to run a MySQL Docker. You can add this MySQL Docker as a Database Server to the Plesk.
Is there a tutorial that explains how to use the docker MySQL image, once installed? so that a user can connect to it and manage database and tables the same way he would do on a regular plesk mysql installation?
TIA
Tony
 
I haven't seen a tutorial for this. But if you have install the Plesk Docker extension, You can start the MySQL docker in command-line like this,

Code:
docker run --name=mysql8 -v /root/mysql8/datadir:/var/lib/mysql -v /root/mysql8/conf.d:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=MySQLRootPassword  -p 127.0.0.1:3307:3306 -p 127.0.0.1:33061:33060 "mysql:latest"

You will have to create these folders, for mapping

/root/mysql8/datadir
/root/mysql8/conf.d

Also use a strong password for MySQLRootPassword.

Via the admin GUI - You can select "Automatic start after system reboot" under docker settings.

Then add this MySQL Docker to Database Servers under Tools & Setting.

I use two different versions of MySQL on the same server. No issues.

so that a user can connect to it and manage database and tables the same way he would do on a regular plesk mysql installation?

Yes. phpMyAdmin, Backup and Restore. All works fine.
 
I haven't seen a tutorial for this. But if you have install the Plesk Docker extension, You can start the MySQL docker in command-line like this,

Code:
docker run --name=mysql8 -v /root/mysql8/datadir:/var/lib/mysql -v /root/mysql8/conf.d:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=MySQLRootPassword  -p 127.0.0.1:3307:3306 -p 127.0.0.1:33061:33060 "mysql:latest"

You will have to create these folders, for mapping

/root/mysql8/datadir
/root/mysql8/conf.d

Also use a strong password for MySQLRootPassword.

Via the admin GUI - You can select "Automatic start after system reboot" under docker settings.

Then add this MySQL Docker to Database Servers under Tools & Setting.

I use two different versions of MySQL on the same server. No issues.

so that a user can connect to it and manage database and tables the same way he would do on a regular plesk mysql installation?

Yes. phpMyAdmin, Backup and Restore. All works fine.
Hi WebHostingAce,

Can you clarify better how to do the mapping?
/root/mysql8/datadir > whatfolder1
/root/mysql8/conf.d > whatfolder2

TIA
tony
 
The above is not a complete tutorial. Its only how I run the different versions of MySQLs in Dockes. Please use it as a reference.

In the above example we are mapping,

/root/mysql8/datadir(Local Folder) :/var/lib/mysql (Docker Folder) - to store the MySQL DB files
/root/mysql8/conf.d(Local Folder):/etc/mysql/conf.d (Docker Folder) - for my.cnf file
 
Back
Top