CEntos 6.7 Migrating from mysql-server/mysql-community-server into latest MariaDB

Ok, first you should install yum-replace plugin if you haven’t already have it.

yum install yum-plugin-replace

Get MariaDB packages repo from MariaDB repos builder here
MariaDB repo builder
You’ll get some repo config text that you can save to /etc/yum.repos.d/MariaDb.repo like these:

# MariaDB 10.1 CentOS repository list - created 2016-04-17 23:39 UTC
# http://mariadb.org/mariadb/repositories/
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64

Do update your repo chache

yum update

If you’re installing mysql-server from CentOS 6.7 default repo, you should do this:

yum replace mysql-libs --replace-with=MariaDB-common

If you’re installing mysql server from webtatic repo (mysql55w-server), you should do this:

yum replace mysql55w-libs --replace-with=MariaDB-common

If you’re installing from MySQL Community repository, do this:

yum replace mysql-community-common --replace-with=MariaDB-common

Just answer with ‘Y’ if the yum replace command show you some conflicts.
Next, just install all MariaDB related packages:

yum install MariaDB-*

Start MariaDB:

/etc/init.d/mysql start

Confirm that you’re using MariaDB:

[root@www ~]# mysql --version
mysql  Ver 15.1 Distrib 10.1.13-MariaDB, for Linux (x86_64) using readline 5.1

Don’t worry, if you have successfully installing MariaDB over MySQL:

  1. your web app that use MySQL will not broken, no need to change anything
  2. your data will stay intact (no data loss)
  3. use MySQL commands as usual (such as: mysql -u root -p)
  4. the MariaDB config is still in /etc/my.cnf

In short, business as usual!

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>