Can't connect remotely to MySQL

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
crypto430
New here
Posts: 2
Joined: Tue Sep 10, 2019 4:11 pm

Can't connect remotely to MySQL

Post by crypto430 » Wed Sep 11, 2019 5:10 pm

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

User avatar
GTunney
Been there, done that
Posts: 591
Joined: Tue Oct 14, 2014 4:16 pm

Re: Can't connect remotely to MySQL

Post by GTunney » Wed Sep 11, 2019 7:45 pm

Have you enabled port 3306 on your firewall?
Model: TS-653B 8GB
FW: 4.4.1.1031 Build: 20190816
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex MS | QCouchPotato | QSabnzbd+ | QSickrage | QHeadphones | HTPC Manager | Kodi v18.4 MySQL
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTC - 80/20 | Netgear GS108 Gigabit Switch

crypto430
New here
Posts: 2
Joined: Tue Sep 10, 2019 4:11 pm

Re: Can't connect remotely to MySQL

Post by crypto430 » 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.

dolbyman
Guru
Posts: 14696
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Can't connect remotely to MySQL

Post by dolbyman » Tue Sep 17, 2019 6:52 pm

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

User avatar
GTunney
Been there, done that
Posts: 591
Joined: Tue Oct 14, 2014 4:16 pm

Re: Can't connect remotely to MySQL

Post by GTunney » Wed Sep 18, 2019 4:41 pm

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.
Model: TS-653B 8GB
FW: 4.4.1.1031 Build: 20190816
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex MS | QCouchPotato | QSabnzbd+ | QSickrage | QHeadphones | HTPC Manager | Kodi v18.4 MySQL
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTC - 80/20 | Netgear GS108 Gigabit Switch

Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”