1、删除系统自带的mysql
rpm -qa|grep mysql
yum remove mysql-libs
2、安装mysql YUM源
rpm -ivh mysql-community-release-el6-5.noarch.rpm
3、安装mysql
yum install mysql-server mysql-devel
4、warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****
rpm --import /etc/pki/rpm-gpg/RPM*
5、root密码设置
service mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root -p 回车直接进去,或者随便输入一个密码
use mysql;
update user set password=PASSWORD("newpass")where user="root";更改密码为 newpassord
flush privileges; 更新权限
quit