Home > Uncategorized > MySQL Connector/Python: on launchpad!

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()
Share
  1. Pedahzur
    May 2nd, 2009 at 17:26 | #1

    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?

  2. Geert JM Vanderkelen
    May 2nd, 2009 at 17:55 | #2

    @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.

  3. Domas Mituzas
    May 3rd, 2009 at 06:08 | #3

    Congrats, sire Geert!

  4. tamana
    March 3rd, 2011 at 09:58 | #4

    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

  5. March 3rd, 2011 at 10:12 | #5

    @tamana
    Change ‘localhost’ to the name or IP address of the remote machine..

  1. No trackbacks yet.