mysql链接liunx远程服务器

Navicat 连接虚拟机处理:
1、 关闭linux中centos7的防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

2、 首先确保 linux服务上mysql 的3306端口是对外开放的

[root@localhostTEST ~]# cd /etc/sysconfig/

[root@localhostTEST sysconfig]# iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPTmysql链接liunx远程服务器_第1张图片
3、 然后登录mysql,开启root权限(mysql命令下执行)
赋予权限: grant all privileges on . to ‘root’@’% 'identified by ‘password’ with grant option![注意:password为自己的数据库密码。
3. 刷新权限列表:
mysql> flush privileges ;

记得结束加英文的 ;

  1. 最后重启mysql服务
    service mysqld restart](https
    /img-blog.csdnimg.cn/2a7b3cdcfe0043648e5924867465cd51.png)

德实赋值

你可能感兴趣的:(mysql,服务器,linux)