CentOS7.2安装MySQL

前端之家收集整理的这篇文章主要介绍了CentOS7.2安装MySQL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

快速下载安装@R_502_198@

# wget http://dev.@R_502_198@.com/get/@R_502_198@-community-release-el7-5.noarch.rpm
# rpm -ivh @R_502_198@-community-release-el7-5.noarch.rpm
# yum install @R_502_198@-community-server

成功安装之后重启@R_502_198@服务

# service @R_502_198@d restart

设置密码

# @R_502_198@ -u root @R_502_198@
@R_502_198@> UPDATE user SET Password=PASSWORD('123456') where USER='root' and host='root' or host='localhost';

@R_502_198@> FLUSH PRIVILEGES;
# quit

启动@R_502_198@

# service @R_502_198@ start
# @R_502_198@ -uroot -p123456

@R_502_198@5.6操作时报错:You must SET PASSWORD before executing this statement解决

@R_502_198@> SET PASSWORD = PASSWORD('123456');

设置远程连接

@R_502_198@> 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

猜你在找的CentOS相关文章