在linux下開發,mysql數據庫是經常用到的,對于初學者來說,在linux怎么安裝卸載mysql數據庫,也許可能比較痛苦,這里簡單介紹下,怎么卸載msql數據庫。
a)查看系統中是否以rpm包安裝的mysql
- [root@linux ~]# rpm -qa | grep -i mysql
- MySQL-server-5.1.49-1.glibc23
- MySQL-client-5.1.49-1.glibc23
[root@linux ~]# rpm -qa | grep -i mysql
MySQL-server-5.1.49-1.glibc23
MySQL-client-5.1.49-1.glibc23
卸載MySQL-server-5.1.49-1.glibc23和MySQL-client-5.1.49-1.glibc23
- [root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23
- [root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23
[root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23
[root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23
b)查看有沒有mysql服務
- [root@linux ~]# chkconfig --list | grep -i mysql
- mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@linux ~]# chkconfig --list | grep -i mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
刪除mysql服務
- [root@linux ~]# chkconfig --del mysql
[root@linux ~]# chkconfig --del mysql
c)刪除分散mysql文件夾
- [root@linux ~]# whereis mysql
- mysql: /usr/lib/mysql /usr/share/mysql
[root@linux ~]# whereis mysql
mysql: /usr/lib/mysql /usr/share/mysql
分別刪除
- [root@linux lib]# rm -rf /usr/lib/mysql/
- [root@linux lib]# rm -rf /usr/share/mysql
[root@linux lib]# rm -rf /usr/lib/mysql/
[root@linux lib]# rm -rf /usr/share/mysql
通過以上幾步,mysql應該已經完全卸載干凈了
原文地址:
http://blog.csdn.net/love__coder/article/details/6894566