mysql-python Code
Status: Beta
Brought to you by:
phalaaxx
| File | Date | Author | Commit |
|---|---|---|---|
| mysql | 2011-01-23 | phalaaxx | [r18] Fixed TypeError exception caused by ignoring NU... |
| COPYING | 2010-01-11 | phalaaxx | [r1] Initial import, v0.4.1 |
| ChangeLog | 2011-01-23 | phalaaxx | [r18] Fixed TypeError exception caused by ignoring NU... |
| README | 2010-10-25 | phalaaxx | [r17] Fixed bug that caused program to segfault on da... |
| _mysql.c | 2010-10-25 | phalaaxx | [r17] Fixed bug that caused program to segfault on da... |
| setup.py | 2011-01-23 | phalaaxx | [r18] Fixed TypeError exception caused by ignoring NU... |
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
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)