1.查看当前Linux版本
[root@wodejindouyun /] cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
2.卸载步骤
- 查看mysql的安装情况
rpm -qa|grep -i mysql # -i参数表示不区分大小写
mysql-community-server-8.0.15-1.el7.x86_64
mysql-community-common-8.0.15-1.el7.x86_64
mysql-community-libs-8.0.15-1.el7.x86_64
mysql-community-client-8.0.15-1.el7.x86_64
- 停服务
systemctl stop mysqld
- 删除mysql
rpm -e --nodeps mysql-community-server
rpm -e --nodeps mysql-community-common
rpm -e --nodeps mysql-community-libs
rpm -e --mysql-community-client
- 删除mysql的安装目录
find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
rm -rf /var/lib/mysql/ #确认无误后,删除目录
cat /etc/my.cnf.rpmsave
log-error=/var/log/mysqld.log
# rm -rf /var/log/mysqld.log #删除/var/log/mysqld.log
卸载完成