"CentOS 7"-Upgrade "MariaDB 5.5" to "MariaDB 10.0" @20210226

#1 add source

#!/bin/sh

cat <<EOF > /etc/yum.repos.d/MariaDB10.repo
# MariaDB 10.0 CentOS repository list – created 2014-10-13 13:04 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb-10.0]
name = MariaDB 10.0
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

#2 data backup

! ! ! Back up the original data! ! !
! ! ! Back up the original data! ! !
! ! ! Back up the original data! ! !

#3 Stop and uninstall the old service

#!/bin/sh 

# Stop the service 
systemctl stop mariadb 

# Delete the old software package 
# (This step will not clear the data, don’t worry) 
yum remove mariadb-server mariadb mariadb-libs 

# Clear the warehouse cache 
yum clean all

#4 Install and start the new service

#!/bin/sh

yum -y install MariaDB-server MariaDB-client

systemctl start mysql

systemctl enable mysql

#5 Upgrade the database (key steps)

This step is to upgrade the system tables in MySQL:

#!/bin/sh

mysql_upgrade -h 127.0.0.1 -u root -p

#6 Verify the upgrade result

#!/bin/sh 

# View version 
mysql -V

related articles

"MariaDB"-Upgrade from "10.0" to "10.3" version

references

How to Upgrade MariaDB 5.5 to MariaDB 10.0 on CentOS 7

Guess you like

Origin blog.csdn.net/u013670453/article/details/114142484