V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tanteng
V2EX  ›  Python

Python3 连 MySQL 的库大家用什么?

  •  
  •   tanteng ·
    tanteng · 2015-05-11 21:57:44 +08:00 · 3339 次点击
    这是一个创建于 3302 天前的主题,其中的信息可能已经有所发展或是发生改变。

    mysqldb好像不支持Python3吧,那么大家在Python3连MySQL用的什么库?

    另外django支持Python3,那么django在Python3下如何做到连MySQL的呢?

    这两个问题,谢谢大家回答!

    7 条回复    2015-05-12 11:38:17 +08:00
    lichun
        1
    lichun  
       2015-05-11 23:21:54 +08:00
    haofly
        2
    haofly  
       2015-05-11 23:22:57 +08:00
    mysqlclient 方便Django用
    yopming
        3
    yopming  
       2015-05-11 23:35:20 +08:00
    mysql-connector-python
    pip的时候要加个allow-external好像
    zijing07
        4
    zijing07  
       2015-05-12 09:36:44 +08:00
    pymysql,提供了mysqldb的适应解决方法,楼上的没用过,之后要尝试对比一下
    carilove
        5
    carilove  
       2015-05-12 10:22:38 +08:00
    之前用的mysql-connector, 毕竟MySQL官方出的。
    但是在用SQLAlchemy的时候, mysql-connector对utf8mb4的支持有问题,转而用pymysql,目前感觉良好
    wingyiu
        6
    wingyiu  
       2015-05-12 10:50:42 +08:00
    mysqlclient a fork of MySQLdb1 with python3 support
    `https://github.com/PyMySQL/mysqlclient-python`
    tanteng
        7
    tanteng  
    OP
       2015-05-12 11:38:17 +08:00
    @zijing07 pymysql是现在主流的用于Python3下连接mysql的库吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1271 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:56 · PVG 01:56 · LAX 10:56 · JFK 13:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.