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

#1 add source

#!/bin/sh

cat <<EOF > /etc/yum.repos.d/MariaDB10.repo
# MariaDB 10.3 CentOS repository list - created 2019-05-18 08:56 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb-10.3]
name = MariaDB 10.3
baseurl = http://yum.mariadb.org/10.3/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 package 
# (This step will not clear the data, don’t worry) 
yum remove -y MariaDB-server MariaDB-client 

# 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 
# Watch out for errors

#6 Verify the upgrade result

#!/bin/sh 

# View version 
mysql -V

related articles

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

Guess you like

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