Navicat 连接虚拟机处理:
- 关闭linux中centos7的防火墙
systemctlstop firewalld.service #停止firewall
systemctldisable firewalld.service #禁止firewall开机启动
- 首先确保 linux服务上mysql 的3306端口是对外开放的
[root@localhostTEST ~]# cd /etc/sysconfig/
[root@localhostTEST sysconfig]# iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
- 然后登录mysql,开启root权限(mysql命令下执行)
赋予权限: grant all privileges on *.* to 'root'@'% 'identified by 'password' with grant option 注意:password为自己的数据库。
3. 刷新权限列表:
mysql> flush privileges ;
记得结束加英文的 ;
4. 最后重启mysql服务
service mysqld restart
德实赋值