mysql-python Code
Status: Beta
Brought to you by:
phalaaxx
File | Date | Author | Commit |
---|---|---|---|
mysql | 2010-03-17 | phalaaxx | [r11] simple update |
COPYING | 2010-01-11 | phalaaxx | [r1] Initial import, v0.4.1 |
ChangeLog | 2010-03-31 | phalaaxx | [r14] changelog import |
README | 2010-03-31 | phalaaxx | [r12] Memory leaks fixed |
_mysql.c | 2010-03-31 | phalaaxx | [r12] Memory leaks fixed |
setup.py | 2010-03-31 | phalaaxx | [r13] version fix |
Requirements: ------------- * Python 3.0+ * MySQL client libraries and development files Installation: ------------- $ svn export http://mypysql.svn.sourceforge.net/svnroot/mypysql mypysql $ cd mypysql $ sudo python3.1 ./setup.py install Example: -------- This is a sample code that shows how to connect to a MySQL database server and submit a query: #!/usr/bin/env python3.1 import mysql db = mysql.connect(host='localhost', user='root', passwd='', db='test') cursor = db.cursor() cursor.execute('SELECT * FROM test1;') for r in cursor.fetchall(): print('NEXT:', r)