1.可能是因为防火墙没关,输入命令关掉Linux的防火墙: 1)service iptables stop 2)iptables -vnL (查看3306端口的状态) iptables -F(关掉防火墙) 2.进入MySQL命令行 grant all privileges on . to root@”%” identified by “密码”; flush privileges; 给本地的IP赋予权限 同时也要也要停掉防火墙