在linux下开发,mysql数据库是常常用到的,对于初学者来讲,在linux怎么安装卸载mysql数据库,也许可能比较痛苦,这里简单介绍下,怎么卸载msql数据库。mysql
a)查看系统中是否以rpm包安装的mysqllinux
[plain] view plaincopysql
[root@linux ~]# rpm -qa | grep -i mysql 数据库
MySQL-server-5.1.49-1.glibc23 spa
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
[root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23 server
[root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23 blog
b)查看有没有mysql服务
[plain] view plaincopy
[root@linux ~]# chkconfig --list | grep -i mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
删除mysql服务
[plain] view plaincopy
[root@linux ~]# chkconfig --del mysql
c)删除分散mysql文件夹
[plain] view plaincopy
[root@linux ~]# whereis mysql
mysql: /usr/lib/mysql /usr/share/mysql
分别删除
[plain] view plaincopy
[root@linux lib]# rm -rf /usr/lib/mysql/
[root@linux lib]# rm -rf /usr/share/mysql
经过以上几步,mysql应该已经彻底卸载干净了