Python and MySQL: is there an alternative to MySQLdb?

前端 未结 8 1380
挽巷
挽巷 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 14:03

    As far as I know there is no direct alternative. The only thing I can think of is to use ODBC instead, via pyodbc. The MySQL site has an ODBC connector you can download. But I've never used this approach myself, so I can't say how well it will work.

    0 讨论(0)
  • 2021-02-05 14:04

    Without a doubt MySQLdb is the best solution, but if you can't use it…

    If you have libmysqlclient.[so|dll], you could access it directly using ctypes module.

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