# wget http://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
# rpm -ivh MysqL-community-release-el7-5.noarch.rpm
# yum install MysqL-community-server
成功安装之后重启MysqL服务
# service MysqLd restart
设置密码
# MysqL -u root MysqL
MysqL> UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost';
MysqL> FLUSH PRIVILEGES;
# quit
启动MysqL
# service MysqL start
# MysqL -uroot -p123456
MysqL5.6操作时报错:You must SET PASSWORD before executing this statement解决
MysqL> SET PASSWORD = PASSWORD('123456');
设置远程连接
MysqL> grant all on *.* to root@'%' identified by '123456';
开启端口
首先在阿里云安全组添加 3306端口
在开启防火墙端口
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --reload
原文链接:https://www.f2er.com/centos/376420.html