Python 3.4.0 with MySQL database(带有 MySQL 数据库的 Python 3.4.0)
问题描述
我已经安装了Python 版本 3.4.0,我想用 MySQL 数据库做一个项目.我下载并尝试安装 MySQLdb,但是对于这个版本的 Python 没有成功.
I have installed Python version 3.4.0 and I would like to do a project with MySQL database. I downloaded and tried installing MySQLdb, but it wasn't successful for this version of Python.
有什么建议可以解决这个问题并正确安装吗?
Any suggestions how could I fix this problem and install it properly?
推荐答案
MySQLdb 不支持 Python 3,但它不是 Python 的唯一 MySQL 驱动程序.
MySQLdb does not support Python 3 but it is not the only MySQL driver for Python.
mysqlclient 本质上只是 MySQLdb 的一个分支,合并了 Python 3 支持(和一些其他改进).
mysqlclient is essentially just a fork of MySQLdb with Python 3 support merged in (and a few other improvements).
PyMySQL 是一个纯 python MySQL 驱动程序,这意味着它更慢,但它不需要编译的 C 组件或 MySQL 库和头文件安装在客户端机器上.它支持 Python 3.
PyMySQL is a pure python MySQL driver, which means it is slower, but it does not require a compiled C component or MySQL libraries and header files to be installed on client machines. It has Python 3 support.
另一种选择是简单地使用另一个数据库系统,如 PostgreSQL.
Another option is simply to use another database system like PostgreSQL.
这篇关于带有 MySQL 数据库的 Python 3.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有 MySQL 数据库的 Python 3.4.0
基础教程推荐
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
