远程数据库开放设置

MYSQL 开启远程访问权限


如有图片资源加载问题请 猛击


  1. 进入数据库,使用mysql表,use mysqlmark
  2. 更改root用户主机地址权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
  3. 刷新权限

mark

到这里权限就设置完成了,还要开启对应的端口及防火墙放行对应端口才可以进行远程连接成功
  • 关闭自带的防火墙firewall

systemctl stop firewalld.service

systemctl disable firewalld.service

systemctl mask firewalld.service

  • 安装iptables 防火墙

yum install iptables-services -y

  • 启动设置防火墙

systemctl enable iptables

systemctl start iptables

  • 查看防火墙状态

systemctl status iptables

mark

  • 编辑防火墙,增加端口

vi /etc/sysconfig/iptables

mark

  • 重启配置,重启系统

systemctl restart iptables.service

systemctl enable iptables.service

  • 接下来就可以远程访问了 ! >_< !
本作品采用《CC 协议》,转载必须注明作者和本文链接
caoayu
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!