Upgrading MariaDB from 5 to 10
Created: 2021-10-21 00:20:45 | Last modified: 2021-11-23 22:34:25
Access: Read | Views: 17 | Rating: N/A | Tags:
Instructions with how to upgrade MariaDB from version 5.5 to 10.6 on Centos 7
Here are instructions with how to upgrade MariaDB from version 5.5 to 10.6 on Centos 7. Centos 8 has version 10.3 available from the appstream repo. If using a virtual environment, take a snapshot before completing any of these steps.
Take a copy of all databases where admin is the SQL username (where the DB root user is root)
mysqldump -u root -p --all-databases --routines --triggers > /root/all-database-backup.sql
Stop MariaDB
systemctl stop mariadb
Remove any additional packages like mariadb-bench (if required)
rpm -e --nodeps mariadb-bench
Keep a copy of the database in another directory (we will now have 2 backups, one is a SQL dump, one is a binary copy)
cp -v -a /var/lib/mysql/ /var/lib/mysql_backup
Create the MariaDB repository
vim /etc/yum.repos.d/MariaDB.repo
Add the following to the file
# MariaDB 10.6 CentOS repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Install the new MariaDB, start and enable the MariaDB services
yum install MariaDB-client MariaDB-server
systemctl restart mariadb
systemctl enable mariadb
systemctl status mariadb
Upgrade the databases (where the DB root user is root)
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -u root -p
Restart MariaDB with new database
systemctl restart mariadb