• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

MariaDB 10 Upgrade From MySQL 5.1 on CentOS 6

Upgrade Mysql to MariaDB

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.

 

 

 

May 5, 2017LinuxAdmin.io
0 0 vote
Article Rating
ModSecurity Installation With Apache On CentOSIptables Introduction and Examples
You Might Also Like
 
Compile Apache 2.4 From Source
 
SELinux Introduction In CentOS 7
Subscribe
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
5 years ago Linux Tutorials, MySQL, Web Hosting centos, linux, Linux Performance Tuning, sysadmin1,034
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
62,989 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,910 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz