1
我有一个在云上运行的MySQL,我需要创建具有选择特权的用户才能在应用程序中使用。然后,这些用户应该能够从外部连接。MySQL不允许远程连接
我这样做:
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT SELECT ON db.* TO 'monty'@'localhost'
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT SELECT ON db.* TO 'monty'@'%';
我/etc/mysql/my.cnf
是这样的:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 0.0.0.0
#skip-networking
但是我无法与外界monty
本地主机连接。 MySQL Workbench给我错误10060
从入站连接的来源开始,一个可能的罪魁祸首是iptables。 TCP 3306是否对远程主机开放? libwrap在'/ etc/hosts.allow'或'/ etc/hosts.deny'中被拒绝时也是可能的,但是iptables更可能。 –
轻松确定您是否可以使用telnet your.db.server 3306从远程机器打开连接。 –
是你出于问题目的而模糊的IP地址(0.0.0.0),还是与文件中的完全相同? – gabe3886