8

I recently starting playing around with the new features of Python 3.1 and porting one of my 2.6 apps. I was surprised to find that MySQLdb does not yet support any of the 3.x versions of Python. My app uses MySQL extensively, so, as you can imagine, I didn't get too far!

What are my options (if any) for working with MySQL and Python 3.1? I've been out of the Python 3k loop, but cursory search did not yield any evidence of a release date for 3.1 support in MySQLdb or any other alternatives.

1
  • 1
    It's quite sad that there are so many good extensions for Python out there but all those won't update for Python 3 :( Commented Dec 5, 2009 at 19:38

2 Answers 2

4

mypysql doesn't follow the Python DB API standard, but does support Mysql and Python 3.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the info, Alex! I had a chance to catch you at OSCON this year (Abstraction Maintenance) and really enjoyed the talk. I'll probably stick with 2.6 for now with an eye towards MySQL support that follows the Python DB API standard.
@jonstjohn, yes, Py2 still gives you more choice in add-ons (and btw, glad you liked my talk -- it's also online at us.pycon.org/2009/conference/schedule/event/75 ).
0

You could use pymysql. "The goal of PyMySQL is to be a drop-in replacement for MySQLdb". Check the docs here.

pip install mysqlclient pymysql

Once these libraries are installed, just add the lines in your project wherever MySQLdb is used.

import pymysql

pymysql.install_as_MySQLdb()

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.