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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠