centos-5的源默认提供mysql-5.0的rpm包,而centos-6的源默认提供mysql-5.1的rpm包,这都有点旧了,下面由www.centos.bz提供yum安装mysql-5.5/5.1的方法
1、导入第三方源webtatic
CentOS-5:
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
CentOS-6:
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
2、安装MySQL client
yum install libmysqlclient15 --enablerepo=webtatic
3、删除存在的mysql
yum remove mysql mysql-*
4、安装mysql
mysql-5.5:
yum install mysql55w mysql55w-server --enablerepo=webtatic
mysql-5.1:
yum install mysql51 mysql51-server --enablerepo=webtatic
5、启动并升级mysql
service mysqld start mysql_upgrade
6、设置开机启动
chkconfig mysqld on