参考文章:CentOS 6.5通过yum安装 MySQL-5.5 网址:https://www.cnblogs.com/wsl222000/p/5445768.html
1、安装mysql-5.5的yum源
rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
2、修改安装好的yum源
编辑 /etc/yum.repos.d/mysql-community.repo文件,将5.5的enabled改为1,5.6的enabled改为0
vi /etc/yum.repos.d/mysql-community.repo
改为
3、安装mysql-5.5
yum install mysql-community-client mysql-community-devel mysql-community-server
4、启动mysql
[root@localhost Desktop]# service mysqld start
......
Please report any problems at http://bugs.mysql.com/ [ OK ]
Starting mysqld: [ OK ]
5、由于mysql刚刚安装完的时候,mysql的root用户的密码默认是空的,所以我们需要及时用mysql的root用户登录(第一次回车键,不用输入密码),并修改密码
# mysql -u root
# use mysql;
# update user set password=PASSWORD("这里输入root用户密码") where User='root';
# flush privileges;