Using MySQLdb for Python database connection
Database login details:
| User Name | | Same as your FTP user name |
| Password | | Same as your FTP password |
| Database | | Your user name with a prefix of "db_" |
| Host | | mysql.int.devisland.net |
Using the above details you will be able to connect to your own database using the Python "MySQLdb" module.
An example of how this is done is shown below:
#!/usr/local/bin/python
#test db connection
import MySQLdb
conn = MySQLdb.connect(host='mysql.int.devisland.net', user='username', passwd='password', db='db_username')
c = conn.cursor()
c.execute("SHOW PROCESSLIST;")
records = c.fetchall()
import pprint
print "Content-type: text\html"
print
pprint.pprint(records)
For more information on how to use databases with Python please use some of the links on the Useful sites page.
|