1、卸载

  1. yum remove -y mariadb mariadb-server python-PyMySQL
  2. # 删除相关包
  3. rpm -qa|grep mariadb
  4. mariadb-5.5.56-2.el7.x86_64
  5. mariadb-libs-5.5.56-2.el7.x86_64
  6. mariadb-server-5.5.56-2.el7.x86_64
  7. rpm -e --nodeps 包名

2、删除遗留目录

  1. [root@node1 ~]# ls /etc/my.cnf
  2. /etc/my.cnf
  3. [root@node1 ~]# ll /var/lib/mysql/
  4. total 28700
  5. -rw-rw---- 1 mysql mysql 16384 May 5 10:31 aria_log.00000001
  6. -rw-rw---- 1 mysql mysql 52 May 5 10:31 aria_log_control
  7. -rw-rw---- 1 mysql mysql 18874368 May 5 10:31 ibdata1
  8. -rw-rw---- 1 mysql mysql 5242880 May 5 10:31 ib_logfile0
  9. -rw-rw---- 1 mysql mysql 5242880 Oct 6 2017 ib_logfile1
  10. drwx------ 2 mysql mysql 4096 Oct 6 2017 mysql
  11. drwx------ 2 mysql mysql 4096 Oct 6 2017 performance_schema
  12. [root@node1 ~]#
  1. rm -rf /etc/my.cnf
  2. rm -rf /var/lib/mysql*
  3. rm -rf /usr/lib64/mysql*
  4. rm -rf ~mysql

3、重新安装

  1. yum install -y mariadb mariadb-server python-PyMySQL
  2. systemctl start mariadb
  3. systemctl enable mariadb
  4. mysql_secure_installation