Unable to connect remotely to MySQL on Node.js image

0

Hi,

I just opened a Lightsail instance on a Node.js image and I'd like to have a MySQL database on it.
I followed this guide (https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ ). Step by step, added a user with host '%' and added the preset MySQL/Aurora port 3306 to the networking config of my Lightsail instance. However when I try to connect remotely (local is fine) using HeidiSQL I get "Can't connect to MySQL server on 'IP-ADDRESS' (10061)".

preguntada hace 5 años374 visualizaciones
1 Respuesta
0
Respuesta aceptada

Hello,
Thank you for using Lightsail.

That guide directs you to bind your MySQL server to localhost. Due to the network configuration of AWS, you need to use 0.0.0.0 in order to bind to external traffic (coming through your Public IP address).

If this is a server you use for a production application, in the interest of security it's recommended to keep the MySQL network port closed in your firewall and use SSH tunneling instead https://docs.bitnami.com/virtual-machine/faq/get-started/access-ssh-tunnel/

In that article, SOURCE means the local port you want to use to connect: ex 23306
DESTINATION is the address on the remote machine you want to reach: ex. 127.0.0.1:3306

Then you'd connect to localhost:23306 in HeidiSQL

Regards,
Gabriel

AWS
MODERADOR
respondido hace 5 años

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