首先保证centos没有自带mysql。

执行 rpm -qa|grep mysql
发现本机有 mysql-libs-5.1.52-1.el6_0.1.x86_64
那么先卸载掉:
rpm -e mysql-libs-5.1.52-1.el6_0.1.x86_64
error: Failed dependencies:
        libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
        mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64

那么只好执行:rpm -e --nodeps mysql-libs-5.1.52-1.el6_0.1.x86_64

接下来就是安装mysql了,你可以到mysql.com 官方网站下载社区版本,为啥是社区版本,因为企业版要钱:(

你可以选择下载,我下载的是 :

m1

 

接下来就是rpm 安装咯~

rpm -ivh  MySQL-client-5.5.28-1.rhel5.x86_64.rpm

rpm -ivh  MySQL-devel-5.5.28-1.rhel5.x86_64.rpm

rpm -ivh  MySQL-server-5.5.28-1.rhel5.x86_64.rpm

安装过程中如果遇到:

error: Failed dependencies:
                                                                  
        libaio.so.1()(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64
                                                                  
        libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64
                                                                  
        libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64
错误,执行    yum -y install libaio     安装依赖库
遇到 需要perl依赖的,那么执行 yum -y install perl  来安装。