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

已提問 5 年前檢視次數 374 次
1 個回答
0
已接受的答案

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
管理員
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南