How to upgrade mariadb 5.5 to 10.1 on CentOS7

来自koorka知识分享
跳转至: 导航搜索
  • Backup or Dump All MariaDB Databases

mysqldump -u root -p --all-databases > /opt/data/backup/all-database.sql

cp -aR /opt/data/mysql /opt/data/backup/mysql.bak systemctl stop mysql

  • Add the MariaDB Repository

yum update vim /etc/yum.repos.d/MariaDB10.repo

# MariaDB 10.1 CentOS repository list - created 2016-01-18 09:58 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
  • Upgrade software to MariaDB 10.1

yum update

mkdir /var/lib/mysql

chown mysql.mysql /var/lib/mysql

systemctl start mariadb

  • Upgrade database to MariaDB 10.1

mysql_upgrade -uroot -p