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)".

posta 5 anni fa374 visualizzazioni
1 Risposta
0
Risposta accettata

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
MODERATORE
con risposta 5 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande