无法远程连接到Node.js镜像上的MySQL。

0

【以下的问题经过翻译处理】 在一个Node.js镜像上打开了一个Lightsail实例,并希望在上面拥有一个MySQL数据库。

我按照这个指南(https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ )逐步进行操作,给添加了一个带有'%'主机的用户,并将预设的MySQL/Aurora端口3306添加到了我的Lightsail实例的网络配置中。然而,当我尝试使用HeidiSQL远程连接(本地连接可以),出现“无法连接到IP-ADDRESS上的MySQL服务器(10061)”的错误提示。

profile picture
EXPERTO
preguntada hace 6 meses6 visualizaciones
1 Respuesta
0

【以下的回答经过翻译处理】 指南要求您将MySQL服务器绑定到localhost。由于AWS的网络配置,您需要使用0.0.0.0才能绑定到外部流量(通过公共IP地址传输)。

如果这是您用于生产应用程序的服务器,出于安全考虑,建议在防火墙中关闭MySQL网络端口,并改用SSH隧道连接,详情请参见https://docs.bitnami.com/virtual-machine/faq/get-started/access-ssh-tunnel/

在该文章中,源端口指的是您想要连接的本地端口:例如23306,目标地址指的是您要到达的远程机器地址:例如127.0.0.1:3306。

然后,您可以在HeidiSQL 中连接localhost:23306。

profile picture
EXPERTO
respondido hace 6 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas