查看当前系统mysql 运行状态
[root@zendlinux ~]# ps -ef |grep mysql
root 1153 1 0 15:40 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/zendlinux.pid
mysql 1695 1153 0 15:40 ? 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/var/zendlinux.err --open-files-limit=65535 --pid-file=/usr/local/mysql/var/zendlinux.pid --socket=/tmp/mysql.sock --port=3306
root 1736 1716 0 15:53 pts/0 00:00:00 grep mysql
查看mysqld状态,并关闭
[root@zendlinux ~]# service mysqld status
SUCCESS! MySQL running (1695)
[root@zendlinux ~]# service mysqld stop
Shutting down MySQL. SUCCESS!
查看开机启动情况
[root@zendlinux ~]# chkconfig --list |grep -i mysql
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
查找MySQL的安装目录并彻底删除
[root@zendlinux ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/local/mysql
[root@zendlinux ~]# find / -name mysql
/var/spool/mail/mysql
/usr/lib/mysql
/usr/include/mysql
/usr/local/mysql
/usr/local/mysql/var/mysql
/usr/local/mysql/include/mysql
/usr/local/mysql/bin/mysql
/usr/bin/mysql
[root@zendlinux ~]# rm -rf /usr/bin/mysql /usr/local/mysql /usr/include/mysql /var/spool/mail/mysql /usr/lib/mysql
[root@zendlinux ~]# find / -name mysql
删除一些配置文件
配置文件一般有/etc/my.cnf 或/etc/init.d/mysqld,视具体安装配置情况而定。
[root@zendlinux ~]# rm -rf /etc/my.cnf
[root@zendlinux ~]# rm -rf /etc/init.d/mysqld
删除MySQL用户以及用户组
[root@zendlinux ~]# id mysql
uid=500(mysql) gid=500(mysql) groups=500(mysql)
[root@zendlinux ~]# userdel mysql
[root@zendlinux ~]# id mysql
相关文章
标签:服务器技术
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式