Home > Database > Mysql Tutorial > 删除卸载Linux自带的MySQL_MySQL

删除卸载Linux自带的MySQL_MySQL

WBOY
Release: 2016-06-01 13:11:32
Original
969 people have browsed it

mysql卸载

linux下彻底卸载mysql 图解教程

1、查找以前是否装有mysql

命令:rpm -qa|grep -i mysql
可以看到如下图的所示:

说明之前安装了:
MySQL-client-5.5.25a-1.rhel5
MySQL-server-5.5.25a-1.rhel5

2、停止mysql服务、删除之前安装的mysql

删除命令:rpm -e –nodeps 包名
# rpm -ev MySQL-client-5.5.25a-1.rhel5
# rpm -ev MySQL-server-5.5.25a-1.rhel5

3、查找之前老版本mysql的目录、并且删除老版本mysql的文件和库

find / -name mysql
查找结果如下:
[root@localhost ~]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql

删除对应的mysql目录
rm -rf /var/lib/mysql
rm -rf /var/lib/mysql
rm -rf /usr/lib64/mysql
具体的步骤如图:查找目录并删除

注意:卸载后/etc/my.cnf不会删除,需要进行手工删除
 rm -rf /etc/my.cnf

4、再次查找机器是否安装mysql

rpm -qa|grep -i mysql
无结果,说明已经卸载彻底、接下来直接安装mysql即可

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template