------查看mysql的启动状态
[root@linuxnode2 ~]# service mysql status
-----查看是否安装过mysql数据库
[root@linuxnode2 ~]# rpm -qa | grep -i mysql
MySQL-server-advanced-5.6.23-1.rhel5
MySQL-devel-advanced-5.6.23-1.rhel5
MySQL-client-advanced-5.6.23-1.rhel5
[root@linuxnode2 ~]#
--停止mysql
[root@linuxnode2 ~]# service mysql stop
Shutting down MySQL.. [ OK ]
--查看mysql服务
[root@linuxnode2 ~]# chkconfig --list |grep -i mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
---删除mysql服务
[root@linuxnode2 ~]# chkconfig --del mysql
[root@linuxnode2 ~]# chkconfig --list |grep -i mysql
[root@linuxnode2 ~]#
--查找有关mysql的文件夹
[root@linuxnode2 ~]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql
/usr/include/mysql
/usr/include/mysql/mysql
/usr/lib/mysql
/usr/bin/mysql
/etc/rc.d/init.d/mysql
/etc/logrotate.d/mysql
--删除mysql文件夹
[root@linuxnode2 ~]# rm -rf /var/lib/mysql
[root@linuxnode2 ~]# rm -rf /usr/share/mysql
[root@linuxnode2 ~]# rm -rf /usr/include/mysql
[root@linuxnode2 ~]# rm -rf /usr/include/mysql/mysql
[root@linuxnode2 ~]# rm -rf /usr/lib/mysql
[root@linuxnode2 ~]# rm -rf /usr/bin/mysql
[root@linuxnode2 ~]# rm -rf /etc/rc.d/init.d/mysql
[root@linuxnode2 ~]# rm -rf /etc/logrotate.d/mysql
[root@linuxnode2 ~]#
--删除my.cnf文件
[root@linuxnode2 ~]# find / -name my.cnf
/usr/my.cnf
[root@linuxnode2 ~]# rm -rf /usr/my.cnf
[root@linuxnode2 ~]#
---查看是否还有安装信息
[root@linuxnode2 ~]# rpm -qa |grep -i mysql
MySQL-server-advanced-5.6.23-1.rhel5
MySQL-devel-advanced-5.6.23-1.rhel5
MySQL-client-advanced-5.6.23-1.rhel5
--删除安装信息
[root@linuxnode2 ~]# rpm -ev MySQL-server-advanced-5.6.23-1.rhel5
[root@linuxnode2 ~]# rpm -ev MySQL-devel-advanced-5.6.23-1.rhel5
[root@linuxnode2 ~]# rpm -ev MySQL-client-advanced-5.6.23-1.rhel5
[root@linuxnode2 ~]#
--再次查找安装信息
[root@linuxnode2 ~]# rpm -qa |grep -i mysql
没有结果重新安装mysql