linux卸载mysql

1.查看是否安装了mysql

rpm -qa | grep -i mysql

   安装了

  

 

 

 2.停止mysql服务,删除之前安装的mysql

停止 service mysql stop
删除
rpm -e MySQL-server-5.5.47-1.linux2.6.x86_64
rpm -e MySQL-client-5.5.47-1.linux2.6.x86_64

3.查看之前老版本mysql的目录,并且删除老版本mysql的文件和库 find / -name mysql

 find / -name mysql

查找结果:

1 /root/mysql
2 /root/Downloads/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/src/java/org/apache/sqoop/mapreduce/mysql
3 /root/Downloads/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/src/test/org/apache/sqoop/manager/mysql
4 /root/Downloads/apache-hive-1.2.0-bin/scripts/metastore/upgrade/mysql
5 /usr/lib64/mysql
6 /var/lib/mysql
7 /var/lib/mysql/mysq

删除对应的mysql目录:

1 rm -rf /root/mysql
2 rm -rf /root/Downloads/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/src/java/org/apache/sqoop/mapreduce/mysql
3 rm -rf /root/Downloads/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/src/test/org/apache/sqoop/manager/mysql
4 rm -rf /root/Downloads/apache-hive-1.2.0-bin/scripts/metastore/upgrade/mysql
5 rm -rf /usr/lib64/mysql
6 rm -rf /var/lib/mysql
7 rm -rf /var/lib/mysql/mysql

4.再次查找机器是否安装mysql

  rpm -qa | grep -i mysql

  卸载成功

 

 

 

 

 

posted @ 2019-09-08 10:52  zhangqi00  阅读(1746)  评论(0编辑  收藏  举报