《MysqL学习Linux下卸载MysqL数据库》要点:
本文介绍了MysqL学习Linux下卸载MysqL数据库,希望对您有用。如果有疑问,可以联系我们。
如何在Linux下卸载MysqL数据库呢? 下面总结、整理了一下Linux平台下卸载MysqL的方法. MysqL的安装主要有三种方式:二进制包安装(Using Generic Binaries)、RPM包安装、源码安装.对应不同的安装方式,卸载的步骤有些不同.文章中如有不足或不对的地方,敬请指出或补充!MysqL应用
[root@DB-Server init.d]# rpm -qa | grep -i MysqL MysqL-devel-5.6.23-1.linux_glibc2.5 MysqL-client-5.6.23-1.linux_glibc2.5 MysqL-server-5.6.23-1.linux_glibc2.5
如上所示,说明安装了MysqL 5.6.23这个版本的client、server、devel三个组件.MysqL应用
[root@DB-Server init.d]# service MysqL status MysqL running (25673)[ OK ] [root@DB-Server init.d]# service MysqL stop Shutting down MysqL..[ OK ] [root@DB-Server init.d]# service MysqL status MysqL is not running[Failed]
[root@DB-Server init.d]# ./MysqL status MysqL running (26215)[ OK ] [root@DB-Server init.d]# ./MysqL stop Shutting down MysqL..[ OK ] [root@DB-Server init.d]# ./MysqL status MysqL is not running[Failed] [root@DB-Server init.d]#
[root@DB-Server init.d]# chkconfig --list | grep -i MysqL MysqL 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@DB-Server init.d]#
[root@DB-Server init.d]# whereis MysqLMysqL应用
MysqL: /usr/bin/MysqL /usr/include/MysqL /usr/share/MysqL /usr/share/man/man1/MysqL.1.gzMysqL应用
最好实用find命令查看MysqL数据库相关的文件,方便后面彻底删除MysqL.MysqL应用
[root@DB-Server init.d]# find / -name MysqL /etc/rc.d/init.d/MysqL /etc/logrotate.d/MysqL /var/lock/subsys/MysqL /var/lib/MysqL /var/lib/MysqL/MysqL /usr/include/MysqL /usr/include/MysqL/MysqL /usr/bin/MysqL /usr/share/MysqL /usr/lib64/MysqL
[root@DB-Server init.d]# [root@DB-Server init.d]# rpm -ev MysqL-devel-5.6.23-1.linux_glibc2.5 [root@DB-Server init.d]# rpm -ev MysqL-server-5.6.23-1.linux_glibc2.5 You have new mail in /var/spool/mail/root [root@DB-Server init.d]# rpm -ev MysqL-client-5.6.23-1.linux_glibc2.5 [root@DB-Server init.d]#
[root@DB-Server init.d]# whereis MysqL MysqL: [root@DB-Server init.d]# find / -name MysqL /var/lib/MysqL /var/lib/MysqL/MysqL /usr/lib64/MysqL [root@DB-Server init.d]# rm -rf /var/lib/MysqL [root@DB-Server init.d]# rm -rf /var/lib/MysqL/MysqL [root@DB-Server init.d]# rm -rf /usr/lib64/MysqL [root@DB-Server init.d]#
如果有必要,删除MysqL用户以及MysqL用户组.MysqL应用
[root@DB-Server ~]# more /etc/passwd | grep MysqL MysqL:x:101:501::/home/MysqL:/bin/bash [root@DB-Server ~]# more /etc/shadow | grep MysqL MysqL:!!:16496:::::: [root@DB-Server ~]# more /etc/group | grep MysqL MysqL:x:501: [root@DB-Server ~]# userdel MysqL [root@DB-Server ~]# groupdel MysqL groupdel: group MysqL does not exist [root@DB-Server ~]#
[root@DB-Server init.d]# rpm -qa | grep -i MysqL
如果是采用二进制包安装的MysqL,那么你用下面命令是找不到任何MysqL组件的.所以如果你不知道MysqL的安装方式,千万不要用下面命令来判别是否安装了MysqLMysqL应用
[root@DB-Server init.d]# rpm -qa | grep -i MysqL
首先通过进程查看是否有MysqL的服务的状态,如下所示,MysqL服务是启动的.MysqL应用
[root@DB-Server init.d]# ps -ef | grep MysqL root 4752 4302 0 22:55 pts/1 00:00:00 more /etc/init.d/MysqL.server root 7176 1 0 23:23 pts/1 00:00:00 /bin/sh /usr/local/MysqL/bin/MysqLd_safe --datadir=/usr/local/MysqL/data --pid-file=/usr/local/MysqL/data/DB-Server.localdomain.pid MysqL 7269 7176 15 23:23 pts/1 00:00:01 /usr/local/MysqL/bin/MysqLd --basedir=/usr/local/MysqL --datadir=/usr/local/MysqL/data --plugin-dir=/usr/local/MysqL/lib/plugin --user=MysqL --log-error=/usr/local/MysqL/data/DB-Server.localdomain.err --pid-file=/usr/local/MysqL/data/DB-Server.localdomain.pid root 7321 4302 0 23:23 pts/1 00:00:00 grep MysqL [root@DB-Server init.d]# /etc/init.d/MysqL.server status MysqL running (7269)[ OK ] [root@DB-Server init.d]# /etc/init.d/MysqL.server stop Shutting down MysqL..[ OK ] [root@DB-Server init.d]# /etc/init.d/MysqL.server status MysqL is not running[Failed] [root@DB-Server init.d]#
[root@DB-Server init.d]# whereis MysqL MysqL: /usr/local/MysqL [root@DB-Server init.d]# find / -name MysqL /var/spool/mail/MysqL /usr/local/MysqL-5.7.5-m15-linux-glibc2.5-x86_64/include/MysqL /usr/local/MysqL-5.7.5-m15-linux-glibc2.5-x86_64/bin/MysqL /usr/local/MysqL-5.7.5-m15-linux-glibc2.5-x86_64/data/MysqL /usr/local/MysqL
[root@DB-Server init.d]# rm -rf /usr/local/MysqL-5.7.5-m15-linux-glibc2.5-x86_64/ [root@DB-Server init.d]# rm -rf /usr/local/ [root@DB-Server init.d]# rm -rf /var/spool/mail/MysqL [root@DB-Server init.d]#
3、删除一些配置文件配置文件一般有/etc/my.cnf 或/etc/init.d/MysqL.server,视具体安装配置情况而定.MysqL应用
[root@DB-Server ~]# id MysqL uid=101(MysqL) gid=501(MysqL) groups=501(MysqL) context=root:system_r:unconfined_t:SystemLow-SystemHigh [root@DB-Server ~]# userdel MysqL
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家PHP.MysqL应用
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。