Nick Koulias's picture

Hi,

I am having issues connecting to mysql from a python script. LAMP setup successful. Logged on and created necessary databases and enabled access. I receive the following error when connecting:

errno=2003, values=(self.get_address(), _strioerror(err)))
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '54.79.57.125:3306' (60 Operation timed out) 

 

Below is the code i use to connect remotely:

db=mysql.connector.connect(user='root', passwd='xxxxx',db='ASX', host='54.79.57.125')

I have also attached screenshots of the mysql setup. Any assistance will be greatly appreciated!

 

Kind regards,

Nick

 

Forum: 
Jeremy Davis's picture

For security reasons all appliances that include MySQL have it bound to localhost by default. So on a LAMP appliance you'll need to configure it to listen on the relevant port (IIRC 3306 by default). Have a look at the docs. If you're running behind a firewall (or on AWS) you'll also need to make sure that access is enabled.

Add new comment