gpt4 book ai didi

python - PyMySQL 是否得到很好的支持?它比 MySQLdb 慢吗?

转载 作者:太空宇宙 更新时间:2023-11-03 13:41:49 25 4
gpt4 key购买 nike

我正在构建一个需要高速连接的 python3 应用程序。作为一个纯 python 库,PyMySQL 在连接和执行查询方面会比基于 C 的 MySQLdb 慢得多吗?

future 版本的 python 是否很好地支持 PyMySQL?

如果没有,谁能推荐一个可靠的替代方案?

最佳答案

PyMySQL 是用纯 Python 实现的,而 MySQLdb 是 C 扩展。 PyMySQL 在某些系统中很容易安装(有时是唯一的方法),而 MySQLdb 有时会出现问题。

但两者都只是 MySQL python 连接器。

Why PyMySQL? MySQL is an immensely popular RDBMS, and you usually need to talk to it when writing a web application in Python. The defacto standard, MySQLdb, is a C extension module that has a reputation of being difficult to compile, especially if you're on a Mac (like I am). Additionally, end-users need to wait for new binaries to be compiled for each new release of Python, and MySQLdb will never run on Jython, IronPython, or PyPy (without something like cpyext or IronClad). We also maintain 100% compatibility between Python 2 and Python 3, so all advancements made on the 2.x trunk will be immediately available on Python 3.

We are developing a drop-in replacement for MySQLdb that "just works" without the hassle of compiling and installing C extensions and without worrying what platform you're on.

来源https://code.google.com/p/pymysql/wiki/Goals

关于python - PyMySQL 是否得到很好的支持?它比 MySQLdb 慢吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29301790/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com