Python and MySQL: is there an alternative to MySQLdb?

前端 未结 8 1391
挽巷
挽巷 2021-02-05 13:09

Is there a module written purely in Python that will allow a script to communicate with a MySQL database? I\'ve already tried MySQLdb without success. It requires too much: GCC,

8条回答
  •  醉酒成梦
    2021-02-05 13:55

    Oracle implemented a pure python mysql connector, aptly named mysql-connector-python. It can be pip-installed and receives plenty of updates.

    Note that it's GPL licensed, which may or may not be a problem for your prjoect. If you can't live with that, you can also pick up PyMySQL instead which is one of the few connectors that works well and is distributed under MIT.

提交回复
热议问题