How do I move from MariaDB to MySQL?
I am wondering if it is possible to migrate my database from MariaDB to MySQL so I can use ServerPilot or a similar service?
You can definitely switch from MariaDB to MySQL. MariaDB is a fork of MySQL so it is a relatively straightforward process. First you will need to perform a datadump using mysqldump:
Once you have the dump you can start to migrate to MySQL. Follow the next steps to do so:
sudo systemctl stop mysql
- Uninstall MariaDB with
sudo apt-get --purge remove "mysql*"
- Remove the configuration file if it exists:
sudo rm /etc/my.cnf
- Install MySQL with :
sudo apt update sudo apt install mysql-server sudo mysql_secure_installation
- Initiate your database backup with:
mysql -uroot -p < database_backup.sql
There you have it!
Keep in mind, you can easily move back to MariaDB if you need to.
Linode Customer Support