MySQL-db lib for Python 3.x?

后端 未结 9 1289
南方客
南方客 2020-12-05 13:16

So, looking for a mysql-db-lib that is compatible with py3k/py3.0/py3000, any ideas? Google turned up nothing.

相关标签:
9条回答
  • 2020-12-05 13:27

    You can download the mysql-connector-python module compatible with Python3:

    http://rpm.pbone.net/index.php3/stat/4/idpl/15667200/dir/rawhide/com/mysql-connector-python3-0.3.2-2.fc16.noarch.rpm.html

    Get the "source RPM", unzip it and use it (e.g. put it in your PYTHONPATH, and look at the examples).

    0 讨论(0)
  • 2020-12-05 13:28

    There is an official Python 2/3 library, downloadable from MySQL website. Oracle released version 1.0.7 to public on 29 September 2012.

    It's pure Python and works with MySQL 4.1+

    See more details here: http://dev.mysql.com/doc/connector-python/en/connector-python.html

    I'm currently using it with MySQL 5.5 and Python 3.2 with no problems thus far :)

    0 讨论(0)
  • 2020-12-05 13:29

    As for future plans of MySQLdb, you might want to ask the author (Andy Dustman).
    His blog is here: http://mysql-python.blogspot.com/

    0 讨论(0)
  • 2020-12-05 13:36

    You're probably better off using Python 2.x at the moment. It's going to be a while before all Python packages are ported to 3.x, and I expect writing a library or application with 3.x at the moment would be quite frustrating.

    0 讨论(0)
  • 2020-12-05 13:38

    It appears the MySQLdb is pretty much a dead project. However, PyMySQL is a dbapi compliant, pure-python implementation of a mysql client, and it has python 3 support.

    EDIT: There's also MySQL Connector/Python. Same idea.

    0 讨论(0)
  • 2020-12-05 13:49

    I was looking for it too, but also found nothing, so I ported MySQL-python-1.2.3 to py3k you can read it here http://sourceforge.net/p/mysql-python/discussion/70460/thread/61e3a3c9/

    0 讨论(0)
提交回复
热议问题