MySQL-db lib for Python 3.x?

后端 未结 9 1290
南方客
南方客 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:52

    Here is a working repository for Python 3: https://github.com/davispuh/MySQL-for-Python-3

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

    There are currently a few options for using Python 3 with mysql:

    https://pypi.python.org/pypi/mysql-connector-python

    • Officially supported by Oracle
    • Pure python
    • A little slow
    • Not compatible with MySQLdb

    https://pypi.python.org/pypi/pymysql

    • Pure python
    • Faster than mysql-connector
    • Almost completely compatible with MySQLdb, after calling pymysql.install_as_MySQLdb()

    https://pypi.python.org/pypi/cymysql

    • fork of pymysql with optional C speedups

    https://pypi.python.org/pypi/mysqlclient

    • Django's recommended library.
    • Friendly fork of the original MySQLdb, hopes to merge back some day
    • The fastest implementation, as it is C based.
    • The most compatible with MySQLdb, as it is a fork
    • Debian and Ubuntu use it to provide both python-mysqldb andpython3-mysqldb packages.

    benchmarks here: https://github.com/methane/mysql-driver-benchmarks

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

    not sure if you're still looking, but you could try this: http://sourceforge.net/projects/mypysql/

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