Linux彻底删除mysql5.6

查看安装的mysql组件

rpm -qa | grep -i mysql

mysql57-community-release-el6-8.noarch
mysql-community-common-5.6.37-2.el6.x86_64
mysql-community-client-5.6.37-2.el6.x86_64
php70w-mysql-7.0.22-2.w6.x86_64
mysql-community-libs-5.6.37-2.el6.x86_64
mysql-community-libs-compat-5.6.37-2.el6.x86_64
mysql-community-server-5.6.37-2.el6.x86_64

查看与mysql相关的文件

find / -name mysql

/home/mysql
/etc/logrotate.d/mysql
/usr/share/mysql
/usr/bin/mysql
/usr/lib64/mysql
/var/spool/mail/mysql
/var/lib/mysql
/var/lib/mysql/mysql

whereis mysql

mysql: /usr/bin/mysql /usr/lib64/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

卸载mysql组件

rpm -ev --nodeps mysql57-community-release-el6-8.noarch
rpm -ev --nodeps mysql-community-common-5.6.37-2.el6.x86_64
rpm -ev --nodeps mysql-community-client-5.6.37-2.el6.x86_64
rpm -ev --nodeps mysql-community-libs-5.6.37-2.el6.x86_64
rpm -ev --nodeps mysql-community-libs-compat-5.6.37-2.el6.x86_64
rpm -ev --nodeps mysql-community-server-5.6.37-2.el6.x86_64

删除mysql相关文件

rm -rf /home/mysql
rm -rf /etc/logrotate.d/mysql
rm -rf /usr/share/mysql
rm -rf /usr/bin/mysql
rm -rf /usr/lib64/mysql
rm -rf /var/spool/mail/mysql
rm -rf /var/lib/mysql
rm -rf /var/lib/mysql/mysql