Python 访问 MySQL 数据库可以使用哪些第三方实现?
展开全部
MySQLdbMySQLdb是 Python 连接 MySQL 最流行的一个驱动,很多框架都也是基于此库进行开发,遗憾的是它只支持 Python2.x,它是基于C开发的库,和Windows 平台的兼容性不友好,现在基本不推荐使用,取代的是它的衍生版本。mysqlclient由于 MySQLdb 年久失修,后来出现了它的 Fork 版本 mysqlclient,完全兼容 MySQLdb,同时支持 Python3.x,是 Django ORM的依赖工具,如果你想使用原生 SQL 来操作数据库,那么推荐此驱动。PyMySQLPyMySQL是纯 Python 实现的驱动,速度上比不上 MySQLdb,最大的特点可能就是它的安装方式没那么繁琐,同时也兼容 MySQLdb。SQLAlchemySQLAlchemy是一种既支持原生 SQL,又支持 ORM 的工具,它非常接近 Java 中的 Hibernate 框架。有关Python访问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
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
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |