rpm -Uvhhttp://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
2、查看mysql可用的源
yum repolistenabled | grep "mysql.*-community.*"
3、yum安装mysql5.6
yum -y installmysql-community-server
4、开机启动
systemctl enablemysqld
5、启动mysqld服务
systemctl startmysqld
6、修改MySQL的root用户的密码:
# mysql -u root mysql
mysql>use mysql;
mysql>desc user;
mysql> GRANT ALL PRIVILEGES ON *.* TOroot@"%" IDENTIFIED BY "root"; //为root添加远程连接的能力。
mysql>update user set Password = password('xxxxxx')where User='root';
mysql>select Host,User,Password from user where User='root';
mysql>flush privileges;
mysql>exit
重新登录:mysql -u root -p
7、 添加软链接# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
# ln -s /usr/local/mysql/include/mysql/usr/include/mysql
8、同时注意防火墙是否已关闭或者添加例外
CentOS防火墙
关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)