我能够在运行时连接到MySQL服务器:
mysql -u devuser -p -h 127.0.0.1 --port=3306
但使用同一台计算机的网络地址时不这样:
mysql -u devuser -p -h 192.168.1.53 --port=3306
在mysql中将devuser设置为devuser @%
MySQL服务器正在运行
pp$> netstat -lnp | grep mysql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 3098/mysqld
unix 2 [ ACC ] STREAM LISTENING 50806 3098/mysqld /var/run/mysqld/mysqld.sock
允许从任何地方(在ufw中配置)连接到端口3306
pp$> ufw status
Status: active
To Action From
-- ------ ----
3306 ALLOW Anywhere
22 ALLOW Anywhere
22/tcp ALLOW Anywhere
3306/tcp ALLOW Anywhere
3306 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
3306/tcp (v6) ALLOW Anywhere (v6)
谢谢。
PP