Mysql远程无法连接
客户端远程连接mysql失败.(mysql server在Ubuntu上)
ip能ping通,telnet ip:3306端口不通 Ubuntu下防火墙已经关闭 sudo ufw disable
Ubuntu ping windwos不通,关闭Windows防火墙后能ping通了
还是连接不上
忘记了MySQL默认禁止#允许所有用户远程访问 修改用户名和密码为你自己的
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME‘@‘%‘ IDENTIFIED BY ‘PASSWORD‘ WITH GRANT OPTION; #允许单个ip 修改用户名和密码为你自己的 mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME‘@‘1.2.3.4‘ IDENTIFIED BY ‘PASSWORD‘ WITH GRANT OPTION; #最后 mysql> FLUSH PRIVILEGES;# 查看防火墙状态
- service iptables status
- service iptables stop
- service iptables start