我应该为MySQL使用哪个python 3库? [英] What python 3 library should I use for MySQL?

查看:280
本文介绍了我应该为MySQL使用哪个python 3库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,MySQLdb仍未移植到Python 3.

As far as I know MySQLdb still isn't ported to Python 3.

在pypy上似乎还有另一个名为PyMySQL的库,但是python 3的安装看起来很奇怪(运行.sh脚本?).还有一个名为PyMySQL3的库,但我找不到有关它的内容的信息.

There seems to be another library called PyMySQL on pypy but the installation for python 3 looks strange (run a .sh script?). Also there is a library called PyMySQL3 but I can't find info about what it's about.

如今,将MySQL与Python 3结合使用的首选方法是什么?

What's the preferred way to use MySQL with Python 3 these days?

是否有一个优雅的解决方案可以通过pip或python setup.py install命令安装?

Is there an elegant solution that could be installed with pip or with a python setup.py install command?

推荐答案

我使用了基本的 mysql-connector 和一些SQLAlchemy.

I've used the basic mysql-connector from MySQL for a few Python 3 projects, along with SQLAlchemy.

我也尝试过 PyMySQL ,但是如果我没记错的话,我在配置它时会遇到更多困难.

I also tried PyMySQL, but if I remember correctly I had a more difficult time configuring it.

这篇关于我应该为MySQL使用哪个python 3库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆