[英]Amazon EC2 - Can't connect remotely to MariaDB
I'm configuring my EC2 server. 我正在配置EC2服务器。 I managed to install php, laravel etc. (with a bit of suffering though).
我设法安装了php,laravel等(虽然有点痛苦)。 Now I
现在我
but still can't login from remote, I get 但仍然无法从远程登录,我得到
ERROR 2003 (HY000): Can't connect to MySQL server on 'yyz.yyz.yyz.yyz' (110)
What can I do? 我能做什么? I don't have any iptables of sort, everything is supposed to be plain simple... but it's not :-(
我没有任何iptables,所有内容都应该很简单...但是不是:-(
I'm trying to connect from outside the Amazon network, with this string 我正在尝试使用此字符串从Amazon网络外部进行连接
mysql -u myuser -pmypwd -h yyz.yyz.yyz.yyz -D myschema
Please notice that from the server itself I can connect using 请注意,从服务器本身,我可以使用
mysql -u myuser -p -h localhost -P 3306 -D myschema
Thank you Marco 谢谢马可
PS For reference, here are my MariaDB users PS供参考,以下是我的MariaDB用户
+---------------------------------------------+-----------+
| host | user |
+---------------------------------------------+-----------+
| % | myuser |
| 127.0.0.1 | root |
| ::1 | root |
| ip-yyz-yy-zz-yyz.us-west-2.compute.internal | root |
| localhost | root |
| localhost | myuser |
+---------------------------------------------+-----------+
EC2 instances have two IP addresses, internal and external. EC2实例有两个IP地址,内部和外部。
It looks to me like your user table authorizes access from the internal IP address. 在我看来,您的用户表授权从内部IP地址进行访问。
ip-yyz-yy-zz-yyz.us-west-2.compute.internal | root
Are you trying to connect to the internal address from outside AWS? 您是否要从AWS外部连接到内部地址? That Doesn't Work™.
那行不通™。
If you're trying to connect to the external address, you'll have to add it to your user list. 如果您尝试连接到外部地址,则必须将其添加到用户列表中。
For troubleshooting but not production, you can add a * | root
对于故障排除而非生产,可以添加
* | root
* | root
user. * | root
用户。
You can also try https://xyz.xyz.xyz.xyz:3306 from a browser. 您也可以从浏览器尝试https://xyz.xyz.xyz.xyz:3306 。 It won't connect, but if it times out you know there's no route to that address from your machine.
它不会连接,但是如果超时,您就会知道没有从您的计算机到该地址的路由。 If it yields some kind of gibberish, immediately, you know the MySQL port is visible.
如果产生某种胡言乱语,您立即就会知道MySQL端口是可见的。
good news and bad news. 好消息和坏消息。
Thank you to everybody who spent time in order to help mi fixing this! 感谢所有花费时间来帮助解决此问题的人!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.