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
Can't connect remotely to MySQL
- GTunney
- Been there, done that
- Posts: 739
- Joined: Tue Oct 14, 2014 4:16 pm
Re: Can't connect remotely to MySQL
Have you enabled port 3306 on your firewall?
Model: TS-453D 8GB
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch
-
- New here
- Posts: 2
- Joined: Tue Sep 10, 2019 4:11 pm
Re: Can't connect remotely to MySQL
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: 35273
- Joined: Sat Feb 12, 2011 2:11 am
- Location: Vancouver BC , Canada
Re: Can't connect remotely to MySQL
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
lots of qnap units are getting hacked via puplic accessible phpMyAdmin installs
- GTunney
- Been there, done that
- Posts: 739
- Joined: Tue Oct 14, 2014 4:16 pm
Re: Can't connect remotely to MySQL
As long as 3306 is open on your firewall and your qnap cloud address is correct then it should work.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.
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-453D 8GB
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch
Disks: 3 x 4TB Western Digital WD40EFRX - RAID 5
Total Storage: 7.2TB
Applications: Plex | Sonarr | QSabnzbd+ | Radarr | Home Assistant | MQTT/Z2M
Other Devices: Netgear D7000 AC1900 VDSL Router | FTTP - 1014/104 | Netgear GS108 Gigabit Switch