发布时间:2014-09-05 17:05:01作者:知识屋
由于redhat Enterprise 5 中自带一个mysql的版本,如果在安装linux前未选择mysql的安装此步就可跳过,因为我当时安装了现在将其卸载 ,步骤如下:
a. 查找已安装的myslq 版本:
#rpm -qa | grep mysql (注意大小写,如果mysql 不行就换MySQL)
出现:
[ysong@sva_rec mysql]$ rpm -qa | grep mysql
mysql-5.0.45-7.el5
libdbi-dbd-mysql-0.8.1a-1.2.2
mysql-5.0.45-7.el5
mysql-server-5.0.45-7.el5
mysql-connector-odbc-3.51.12-2.2
卸载后/var/lib/mysql中的数据及/etc/my.cnf不会删除,如果确定没用后就手工删除
rm -f /etc/my.cnf
rm -rf /var/lib/mysql
后,在输入命令:
[ysong@sva_rec mysql]$ sudo yum -y remove mysql-5.0.45-7.el5
Password:
Loading "security" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.0.45-7.el5 set to be erased
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: dovecot
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: mysql-connector-odbc
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: libdbi-dbd-mysql
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: dovecot
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: mysql-connector-odbc
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: libdbi-dbd-mysql
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: mysql-connector-odbc
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: MySQL-python
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: mysql-connector-odbc
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: MySQL-python
--> Processing Dependency: mysql for package: libdbi-dbd-mysql
--> Processing Dependency: mysql = 5.0.45-7.el5 for package: mysql-server
--> Processing Dependency: mysql for package: MySQL-python
---> Package mysql.i386 0:5.0.45-7.el5 set to be erased
--> Running transaction check
---> Package mysql-server.x86_64 0:5.0.45-7.el5 set to be erased
---> Package MySQL-python.x86_64 0:1.2.1-1 set to be erased
---> Package libdbi-dbd-mysql.x86_64 0:0.8.1a-1.2.2 set to be erased
---> Package perl-DBD-MySQL.x86_64 0:3.0007-1.fc6 set to be erased
---> Package mysql-connector-odbc.x86_64 0:3.51.12-2.2 set to be erased
---> Package dovecot.x86_64 0:1.0.7-2.el5 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
mysql x86_64 5.0.45-7.el5 installed 7.5 M
mysql i386 5.0.45-7.el5 installed 7.3 M
Removing for dependencies:
MySQL-python x86_64 1.2.1-1 installed 288 k
dovecot x86_64 1.0.7-2.el5 installed 3.7 M
libdbi-dbd-mysql x86_64 0.8.1a-1.2.2 installed 55 k
mysql-connector-odbc x86_64 3.51.12-2.2 installed 420 k
mysql-server x86_64 5.0.45-7.el5 installed 22 M
perl-DBD-MySQL x86_64 3.0007-1.fc6 installed 328 k
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 8 Package(s)
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : mysql-server ######################### [1/8]
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
Erasing : MySQL-python ######################### [2/8]
Erasing : mysql ######################### [3/8]
Erasing : libdbi-dbd-mysql ######################### [4/8]
Erasing : perl-DBD-MySQL ######################### [5/8]
Erasing : mysql-connector-odbc ######################### [6/8]
Erasing : dovecot ######################### [7/8]
Erasing : mysql ######################### [8/8]
Removed: mysql.x86_64 0:5.0.45-7.el5 mysql.i386 0:5.0.45-7.el5
Dependency Removed: MySQL-python.x86_64 0:1.2.1-1 dovecot.x86_64 0:1.0.7-2.el5 libdbi-dbd-mysql.x86_64 0:0.8.1a-1.2.2 mysql-connector-odbc.x86_64 0:3.51.12-2.2 mysql-server.x86_64 0:5.0.45-7.el5 perl-DBD-MySQL.x86_64 0:3.0007-1.fc6
Complete!
[ysong@sva_rec mysql]$
OK,到此,Linux下自带的mysql已经完全卸载,此时,再输入:
[ysong@sva_rec mysql]$ rpm -qa | grep mysql
[ysong@sva_rec mysql]$
显示系统已经没有mysql服务;
[ysong@sva_rec mysql]$ netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
linux一键安装web环境全攻略 在linux系统中怎么一键安装web环境方法
Linux网络基本网络配置方法介绍 如何配置Linux系统的网络方法
Linux下DNS服务器搭建详解 Linux下搭建DNS服务器和配置文件
对Linux进行详细的性能监控的方法 Linux 系统性能监控命令详解
linux系统root密码忘了怎么办 linux忘记root密码后找回密码的方法
Linux基本命令有哪些 Linux系统常用操作命令有哪些
Linux必学的网络操作命令 linux网络操作相关命令汇总
linux系统从入侵到提权的详细过程 linux入侵提权服务器方法技巧
linux系统怎么用命令切换用户登录 Linux切换用户的命令是什么
在linux中添加普通新用户登录 如何在Linux中添加一个新的用户
2012-07-10
CentOS 6.3安装(详细图解教程)
Linux怎么查看网卡驱动?Linux下查看网卡的驱动程序
centos修改主机名命令
Ubuntu或UbuntuKyKin14.04Unity桌面风格与Gnome桌面风格的切换
FEDORA 17中设置TIGERVNC远程访问
StartOS 5.0相关介绍,新型的Linux系统!
解决vSphere Client登录linux版vCenter失败
LINUX最新提权 Exploits Linux Kernel <= 2.6.37
nginx在网站中的7层转发功能