MySQL Connector/Python: on launchpad!
I’m happy to announce (bit unofficially) the first (alpha) source code release of MySQL Connector/Python. It’s hosted on Launchpad and can be downloaded using the Bazaar client. It’s more a preview as I’m still working on it during free time. Please post comments, bug reports, ideas, critics, etc..
MySQL Connector/Python is a rewrite of the MySQL Protocol in Python. It does not require the C library libmysqlclient, thus no compiling. However, I’m currently working on making a version which will be linked with the MySQL libraries, for performance.
Small, silly example:
#!/usr/bin/env python import mysql.connector db = mysql.connector.Connect(host='localhost') cursor = db.cursor() stmt = "SELECT VERSION()" cursor.execute(stmt) row = cursor.fetchone() print row db.close()
Facebook
LinkedIn
Twitter
Since this wasn't addressed in the README: I assume the driver is DB API 2.0 compliant?
Also, what optional features (such as .lastrowid) do you support?
@Pedahzur
Yes, it should be DB API 2.0 compliant. If not, leave a bug report and I'll address it :)
I'll look at the lastrowid thing.
Congrats, sire Geert!
what changes i hv to make in this line
db = mysql.connector.Connect(host=’localhost’)cursor = db.cursor()
if my client and server are on diffrent machines??
this will work only when they both are on same m/c
@tamana
Change ‘localhost’ to the name or IP address of the remote machine..