1.下载MysqL安装包
https://downloads.MysqL.com/archives/community/
[1]查询MysqL是否已经安装
[root@pluto 桌面]#ps -ef|grep MysqL
root 7921 6778 0 23:00 pts/3 00:00:00 grep MysqL
[root@pluto 桌面]#rpm -qa|grep MysqL
MysqL-libs-5.1.73-7.el6.x86_64
[root@pluto 桌面]#uname -a
Linux pluto.pluto 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
rpm包名基本格式:MysqL-libs-5.1.73-7.el6.x86_64
|-名称:MysqL-libs
|-版本号:5.1.73
|-适用操作系统:el6.x86_64,表示centos6.x的64位系统
通过以上的信息我们可以得知MysqL已经安装了,所以我们只需要卸载就好了。安装我们想要的MysqL版本。
[2]卸载原MysqL
#普通删除模式
[root@pluto 桌面]# rpm -e MysqL-libs
error: Failed dependencies:
libMysqLclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64
libMysqLclient.so.16(libMysqLclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64
MysqL-libs is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64
#强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
[root@pluto 桌面]# rpm -e --nodeps MysqL-libs
[1]安装MysqL
[root@pluto opt]# rpm -ivh MysqL-server-5.5.48-1.linux2.6.i386.rpm
[root@pluto opt]#rpm -iv