Hi all, I am learning python and wonder if I can connect to a mySQL database server hosted by my hosting service (bluehost). The script just hangs with no response.
Disclaimers:
- I'm not sure what a port is, nor how to use it.
- I have a link that will get me phpmyadmin on the bluehost server. The format of the link is like this: http://AA.BB.CC.DD:YYYY/3rdparty/phpmyAdmin/index.php
- Notice I removed the ip numbers
- I am on a laptop that is behind a firewall (linksys router).
- Bluehost forums say something about being whitelisted. Not sure what this means either.
Code:
import MySQLdb
myDB = MySQLdb.connect(host="AA.BB.CC.DD", port=YYYY, user="**********", passwd="*****************")
cHandler=myDB.cursor()
cHandler.execute("SHOW DATABASES")
results=cHandler.fetchall()
print "========================="
for items in results:
print items[0]
Bookmarks