steps by steps upgrade mariadb 5.x to 10.2 in centos 7

steps by steps upgrade mariadb 5.x to 10.2 in centos 7

steps by steps upgrade mariadb 5 to 10 in centos 7. first take backup of database, remove mariadb 5, install mariadb 10.2 repo & install mariadb 10.2. after install start service & run  mysql_upgrade command then check version
Step 1  

Backup databases and data directory

mysqldump -u root -p -R -E --all-databases > /tmp/all-database-backup.sql

mariadb, mariadb-server, mariadb server, mysql, database, database backup, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mariadb upgrade in centos,

Check backup *.sql

    ll /tmp/

mariadb10.2-backup1.png
Stop mariadb server

systemctl stop mariadb.service

Copy the databases directory in a separate

cp -ar /var/lib/mysql/ /var/lib/mysql.bak

Note : In case of failure of the upgrade you can use one of the above copies to restore your databases.

Step 2

Add the MariaDB Repository.

echo "[mariadb]
name = MariaDB
gpgcheck=1" >> /etc/yum.repos.d/MariaDB10.2.repo

OR
vi /etc/yum.repos.d/MariaDB10.2.repo

Add the following text in it:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Step 3

Remove MariaDB 5.5

    rpm -qa | grep mariadb*

mariadb, mariadb-server, mariadb server, mysql, database, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mariadb upgrade in centos,

rpm -e --nodeps mariadb-server-5.5.50-1.el7_2.x86_64 mariadb-devel-5.5.50-1.el7_2.x86_64 mariadb-libs-5.5.50-1.el7_2.x86_64 mariadb-5.5.50-1.el7_2.x86_64

mariadb, mariadb-server, mariadb server, mysql, database, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mariadb upgrade in centos,
Step 4

Installing MariaDB 10.2

yum -y install MariaDB-server

mariadb, mariadb-server, mariadb server, mysql, database, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mariadb upgrade in centos,

Start the MariaDB service with:

systemctl start mariadb

Enable MariaDB to automatically start after system boot

systemctl enable mariadb

Finally run the upgrade command to upgrade MariaDB with:

mysql_upgrade

mariadb, mariadb-server, mariadb server, mysql, database, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mariadb upgrade in centos,

To verify that the upgrade was successful, run the following command:

mysql -V

mariadb, mariadb-server, mariadb server, mysql, database, mariadb 10.2, upgrade mariadb, upgrade mariadb 5.x to 10.x, upgrade mariadb 5.5 to 10.2, step by step mariadb upgrade, mariadb 5.5 upgrade in centos, mysql backup, database backup, mariadb backup,  mariadb upgrade in centos,

Previous
Next Post »