linux 怎麼徹底卸載mysql數據庫

  在linux下開發,mysql數據庫是常常用到的,對於初學者來講,在linux怎麼安裝卸載mysql數據庫,也許可能比較痛苦,這裏簡單介紹下,怎麼卸載msql數據庫。mysql

a)查看系統中是否以rpm包安裝的mysqllinux

[plain] view plaincopysql

  1. [root@linux ~]# rpm -qa | grep -i mysql  數據庫

  2. MySQL-server-5.1.49-1.glibc23  spa

  3. MySQL-client-5.1.49-1.glibc23  .net

卸載MySQL-server-5.1.49-1.glibc23和MySQL-client-5.1.49-1.glibc23
code

[plain] view plaincopyorm

  1. [root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23  server

  2. [root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23  blog

b)查看有沒有mysql服務

[plain] view plaincopy

  1. [root@linux ~]# chkconfig --list | grep -i mysql  

  2. mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off  

刪除mysql服務

[plain] view plaincopy

  1. [root@linux ~]# chkconfig --del mysql  

c)刪除分散mysql文件夾

[plain] view plaincopy

  1. [root@linux ~]# whereis mysql  

  2. mysql: /usr/lib/mysql /usr/share/mysql  

分別刪除

[plain] view plaincopy

  1. [root@linux lib]# rm -rf /usr/lib/mysql/  

  2. [root@linux lib]# rm -rf /usr/share/mysql  


經過以上幾步,mysql應該已經徹底卸載乾淨了

相關文章
相關標籤/搜索