• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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
 
If anyone in 2025 or later wants to try the suggested Docker container mentioned here I would advice not to do it.
We have a relatively big webshop running in Craft CMS 5 where MariaDB is discouraged.
The Docker container running the MySQL DB does its job but the binlogs keep growing and are currently 250GB in size.
Aside from that the performance is really bad.

I would suggest to stay away from using Docker in Plesk for websites with a lot of traffic and DB interactions.
Either throw MariaDB out entirely and switch to MySQL or move to another platform than Plesk.
 
The binlogs are not mandatory. If SQL replication is not implemented then simply disable the binlog:

If binglogs are needed then simply set a binlog retention period:

I'm not sure what to say performance wise. Do you have any custom variables set in the docker container my.cnf?
 
I installed Docker using the Plesk Docker extension.
My hosting provider also does not allow me root access to I can't run any console commands for docker.
Everything is configured using the Plesk Docker extension which does not allow these things to be changed.

If you have root access and have sufficient Docker knowledge then this might be a good path to go with but for the average web developer I would advice to not use it. Every few months the docker container crashes and reboot on its own. Not the biggest of issues but it's just not worth it.
 
hmm, I wonder if Plesk should install MariaDB on a custom port/folder/config separate from the default MySQL/MariaDB install settings, this would allow you install either MariaDB or Mysql as your "production" database...just a thought..

You could also just spin up a separate db server of your choice and add it to your Plesk server.
 
Back
Top