MySQL中应该使用什么python 3库?

时间:2022-12-04 07:14:38

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

据我所知,MySQLdb仍然没有移植到Python 3。

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.

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

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

现在使用MySQL和Python 3的首选方式是什么?

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

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

1 个解决方案

#1


4  

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

我在几个Python 3项目中使用了MySQL的基本MySQL -connector,以及SQLAlchemy。

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

我也尝试了PyMySQL,但是如果我没记错的话,我将很难配置它。

#1


4  

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

我在几个Python 3项目中使用了MySQL的基本MySQL -connector,以及SQLAlchemy。

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

我也尝试了PyMySQL,但是如果我没记错的话,我将很难配置它。