Dedicated Server Converting from MySQL 5.5 to MariaDB 5.5

Dedicated Server Converting from MySQL 55 to MariaDB 55
Dedicated Server Converting from MySQL 55 to MariaDB 55


If you’re running MySQL 5.5 and wish to convert to MariaDB 5.5 (which then allows a higher MariaDB later on), then you can do the following:

  1. Make full DA User backups, and .sql backups before you do anything else. Ensure the backups are okay and ready for restore, in case anything goes wrong. To create the .sql backups, type:
cd /usr/local/directadmin/custombuild
./build set mysql_backup yes
./build mysql_backup
mv mysql_backups mysql_backups.`date +%F`
./build set mysql_backup no
  1. Make a copy of the /var/lib/mysql folder (/home/mysql on Debian). We’ll stop mysqld first, to avoid corruption during the copy.
perl -pi -e 's/mysqld=ON/mysqld=OFF/' /usr/local/directadmin/data/admin/services.status
service mysqld stop
cd /var/lib
cp -Rp mysql mysql.conversion_backup
rpm -e `rpm -qa | grep MySQL`
./build set mariadb 5.5
./build set mysql_inst mariadb
./build mariadb
./build php n
perl -pi -e 's/mysqld=OFF/mysqld=ON/' /usr/local/directadmin/data/admin/services.status
./build set mysql_backup yes

Now that you’re in the MariaDB family, you can upgrade to 10.0 or 10.1 from 5.5. I do not recommend going directly from MySQL 5.5 to MariaDB 10.x, even though it might work.

Rules for versions

Please see the MariaDB Documentation on upgrading from MySQL to MariaDBopen in new window to ensure the value you’re converting to is supported, based on your current version’s data.

Forcing mysql_upgrade after a version change

When MySQL/MariaDB is updated in CustomBuild, it should automatically call the mysql_upgrade command. Sometimes, you might be working with things manually, or just want try force another upgrade call.

To do this, run:

mysql_upgrade --defaults-extra-file=/usr/local/directadmin/conf/my.cnf --force

Note, on Debian systems, the binary is at:

/usr/local/mysql/bin/mysql_upgrade --defaults-extra-file=/usr/local/directadmin/conf/my.cnf --force

Leave A Comment

What’s happening in your mind about this post !

Your email address will not be published. Required fields are marked *