linux卸载mysql数据库

linux卸载mysql数据库的步骤:第一步:查看系统中是否以rpm包安装的mysql [plain] view plaincopyprint?[root@linux ~]# rpm -qa | grep -i mysql MySQL-server-5.1.49-1.glibc23 MySQL-client-5.1.49-1.glibc23 第二步:卸载MySQL-server-5.1.49-1.glibc23和MySQL-client-5.1.49-1....
linux卸载mysql数据库
卸载mysql1、查找以前是否装有mysql
命令:rpm -qa|grep -i mysql
可以看到mysql的两个包:
mysql-*..*.RHEL**
mysqlclient*.RHEL**
2、删除mysql
删除命令:rpm -e --nodeps 包名
( rpm -ev mysql-*.RHEL* )
3、删除老版本mysql的开发头文件和库
命令:rm -fr /usr/lib/mysql
rm -fr /usr/include/mysql
注意:卸载后/var/lib/mysql中的数据及/etc/my.cnf不会删除,如果确定没用后就手工删除
rm -f /etc/my.cnf
  rm -fr /var/lib/mysql2016-09-17
linux卸载mysql数据库的步骤:

第一步:查看系统中是否以rpm包安装的mysql

[plain] view plaincopyprint?
[root@linux ~]# rpm -qa | grep -i mysql
MySQL-server-5.1.49-1.glibc23
MySQL-client-5.1.49-1.glibc23

第二步:卸载MySQL-server-5.1.49-1.glibc23和MySQL-client-5.1.49-1.glibc23

[plain] view plaincopyprint?
[root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23
[root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23

第三步:查看有没有mysql服务
[plain] view plaincopyprint?
[root@linux ~]# chkconfig --list | grep -i mysql
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

第四步:删除mysql服务

[plain] view plaincopyprint?
[root@linux ~]# chkconfig --del mysql

第五步:删除分散mysql文件夹

[plain] view plaincopyprint?
[root@linux ~]# whereis mysql
mysql: /usr/lib/mysql /usr/share/mysql

第六步:分别删除
[plain] view plaincopyprint?
[root@linux lib]# rm -rf /usr/lib/mysql/
[root@linux lib]# rm -rf /usr/share/mysql

通过以上步骤就可以卸载干净mysql了。
2016-09-21
mengvlog 阅读 51 次 更新于 2025-12-19 02:26:20 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部