X

MariaDB 10 Upgrade From MySQL 5.1 on CentOS 6

MariaDB is a fork of MySQL that was created from some of the original developers of mysql after MySQL was purchased by Oracle. Upgrading to MariaDB offers a range of benefits and is a relatively simple upgrade. It has more active development then MySQL currently and is just developed by Oracle support as MySQL is.  It has more storage engines and better performance. Offering a 3-5% performance gain over using  MySQL. It has active-active clustering. It is compatible and easy to upgrade.  While this upgrade is  for CentOS 6, you can get all off the different repositories here . 

 

Take a backup of all the MySQL databases:

You can do this one of two ways

mysqldump --all-databases > all.sql

Or just copy all of the MySQL raw files:

cp -R /var/lib/mysql /var/lib/mysql.back

This will allow you to revert if there are any issues.

Upgrade to MariaDB 5.5

Shut down MySQL

service mysqld stop

Create a new repo /etc/yum.repos.d/MariaDB55.repo and add the following:

# MariaDB 10.0 CentOS repository list - created 2017-05-06 01:14 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Remove mysql:

yum remove -y mysql mysql-devel mysql-libs mysql-server

Make a note of any other other dependencies you may have installed as those will need to be re installed after version 10 has been installed.

Install version 5.5

yum install mariadb mariadb-server mariadb-devel mariadb-lib

Start services

service mariadb start

Upgrade the databases

mysql_upgrade

Ugprade to MariaDB 10.1

First shutdown  5.5

service mariadb stop

Remove the old version

yum remove -y  mariadb mariadb-server mariadb-devel mariadb-lib

Create a new MariaDB 10.1 repository /etc/yum.repos.d/MariaDB101.repo and add the following

# MariaDB 10.1 CentOS repository list - created 2017-05-06 01:20 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

 

Install MariaDB 10.1 packages:

yum install mariadb mariadb-server mariadb-devel mariadb-lib

Start services:

service mariadb start

Upgrade the databases:

mysql_upgrade

If you are running PHP built from source, you will need to recompile PHP against the new version of MariaDB after the upgrade for it to work properly.

That is it, you should now be running 10.1. All of the old options in you my.cnf should work after the upgrade. You can now use the Aria Storage engine for internal temporary files instead of MyISAM. Set aria-pagecache-buffer-size to the same value as you have for key-buffer-size. If you have a lot of connections(>100) you can setup a thread pool to increase performance.

 

 

 

LinuxAdmin.io
0 0 votes
Article Rating
LinuxAdmin.io:
Related Post