Page 1 of 1

Can't connect remotely to MySQL

Posted: Wed Sep 11, 2019 5:10 pm
by crypto430
Hi, I am not able to connect remotely to MySQL from my python script. I can connect locally. I have tcp/ip networking enabled on port 3306. I can connect to the NAS remotely with no problem. I have tried user accesses even going as far as giving global access to %.

Here is my latest connection request

con = pymysql.connect('https://xxxxxx.myqnapcloud.com', 'root', 'xxxxxxxxxxxx', 'TestDB')

Here is the error I am getting

pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'https://xxxxxx.myqnapcloud.com' ([Errno -2] Name or service not known)")

Thank you in advance for your assistance
Bob

Re: Can't connect remotely to MySQL

Posted: Wed Sep 11, 2019 7:45 pm
by GTunney
Have you enabled port 3306 on your firewall?

Re: Can't connect remotely to MySQL

Posted: Tue Sep 17, 2019 6:08 pm
by crypto430
yes I have. is the host name i'm trying to connect to correct? (https://xxxxxx.myqnapcloud.com) xxxxxx is my qnap userid. I can get to phpmyadmin remotely.

Re: Can't connect remotely to MySQL

Posted: Tue Sep 17, 2019 6:52 pm
by dolbyman
make sure you keep the phpMAdmin updated and the passwords strong (or better not expose it at all)

lots of qnap units are getting hacked via puplic accessible phpMyAdmin installs

Re: Can't connect remotely to MySQL

Posted: Wed Sep 18, 2019 4:41 pm
by GTunney
crypto430 wrote:
Tue Sep 17, 2019 6:08 pm
yes I have. is the host name i'm trying to connect to correct? (https://xxxxxx.myqnapcloud.com) xxxxxx is my qnap userid. I can get to phpmyadmin remotely.
As long as 3306 is open on your firewall and your qnap cloud address is correct then it should work.

One to take into account is i don't think Phpmyadmin works with SSL.

Everytime I have to connect locally I need to use http not https.