centos7.8设置mysql远程连接(remote mysql)
1.登录MySQL,如出现登录问题-------请见我的上两篇文章:
MySQL登录错误解决
修改MySQL密码
2.“select User,Password,Host from mysql.user;” #查看相关信息
#“%”代表所有,允许远程连接host
3.“insert into user (User,Password,Host)values(‘root’,password,’%’);”
#赋予所有权限
4.“grant all privileges on . to ‘root’@’%’ identified by ‘password’;”
5.“flush privileges;” #立即生效
6.systemctl restart mysqld.server #重启MySQL
7.如果还不能远程连接,请注意问题:放开防火墙3306端口
8.效果展示: