CGI

ID #174

How do I use MySQL with Python?

Applies to: Grid System

You can use the Python mysqldb module by importing it like this in a python script that is chmod 755:

#!/usr/bin/python
import MySQLdb

def main():
print "Content-type: text/html\n"
print "hello!"

main()

More documentation on using mysqldb is at http://www.sourceforge.net/projects/mysql-python/.


Last update: 2010-10-03 13:11
Author: FAQ Admin
Revision: 1.2

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 (0 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ

Comment of Anonymous:
See the Devshed article on using mysqldb at http://www.devshed.com/Server_Side/Python/PythonMySQL/page1.html
Added at: 2002-08-23 19:29