1.查看安装的mysql
[root@localhost jwzt]# rpm -qa | grep -i mysql
MySQL-python-1.2.5-1.el7.x86_64
[root@localhost jwzt]#
2.关闭mysql服务
第一种方式:
[root@localhost init.d]# service mysql status
SUCCESS! MySQL running (8556)
[root@localhost init.d]# service mysql stop
Shutting down MySQL.. SUCCESS!
[root@localhost init.d]# service mysql status
ERROR! MySQL is not running
[root@localhost init.d]#
第二种方式:
[root@localhost init.d]# ./mysql status
SUCCESS! MySQL running (9004)
[root@localhost init.d]# ./mysql stop
Shutting down MySQL... SUCCESS!
[root@localhost init.d]# ./mysql status
ERROR! MySQL is not running
[root@localhost init.d]#
3.删除mysql
rpm -ev MySQL-python-1.2.5-1.el7.x86_64 --nodeps
4. 查找所有mysql目录,删除文件
[root@localhost init.d]# whereis mysql
mysql: /usr/lib64/mysql /usr/local/mysql /usr/share/mysql #我只删除了这三个文件
[root@localhost init.d]# find / -name mysql
/run/sudo/ts/mysql
find: ‘/run/user/1000/gvfs’: 权限不够
/etc/rc.d/init.d/mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/pcp/config/pmlogconf/mysql
/var/db/sudo/lectured/mysql
/var/spool/mail/mysql
/usr/lib64/mysql
/usr/share/mysql
/usr/local/mysql
/usr/local/mysql/bin/mysql
/usr/local/mysql/include/mysql
/usr/local/mysql/data/mysql
/home/mysql
[root@localhost init.d]#
删除my.cnf
rm -rf /etc/my.cnf