I'm trying to write a Python script that will connect to a Database. The host URL of the database was given to me in jdbc format:
URL = jdbc:mysql://www.myurl.com:3306/
I can't figure out how to translate that URL into pythonese.
Any help would be appreciated. Thanks
import MySQLdb
conn = MySQLdb.connect(host="????",user="web3u4",passwd="password",db="web3db4")
cursor = conn.cursor ()
cursor.execute ("SELECT VERSION()")
row = cursor.fetchone ()
print "server version:", row[0]
cursor.close ()
# disconnect from server
db.close()