1.移除CentOS默认的mysql-libs: whereis mysql
2.为了避免冲突,先移除CenttOS上默认的mysql-libs: yum remove mysql-libs
3.然后,使用yum clean dbcache清空db缓存:
4.下载MySQL rpm安装包:
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysql
5.yum install mysql-community-server -y
6.设置为开机自启动
chkconfig --list | grep mysqld
chkconfig mysqld on
7.启动
8.设置密码:
/usr/bin/mysqladmin -u root password '123456
9.修改密码:
mysql -uroot -p密码
update user set password = PASSWORD("xxxxxxxx") where user = "root"
10.退出数据库,exit;
11.重启数据库服务,service mysqld restart
over.