V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
simple2025
0D
V2EX  ›  Python

问下你们使用 gevent+flask 的时候用的什么 mysql 驱动

  •  
  •   simple2025 · Mar 31, 2017 · 4971 views
    This topic created in 3318 days ago, the information mentioned may be changed or developed.
    Mysqldb这个库好像不支持异步
    如果都用的是这个库的话,不支持也没有办法。。
    我也只能用 Mysql-python
    
    
    11 replies    2017-03-31 14:27:54 +08:00
    KIDJourney
        1
    KIDJourney  
       Mar 31, 2017
    不用 pymysql 不能 patch 吧。
    Zuckonit
        2
    Zuckonit  
       Mar 31, 2017
    官方的 mysql-connector 吧,生产环境用了很长时间了
    simple2025
        3
    simple2025  
    OP
       Mar 31, 2017
    @KIDJourney 你是用的 pymysql ?有没有出什么问题?
    est
        4
    est  
       Mar 31, 2017
    simple2025
        5
    simple2025  
    OP
       Mar 31, 2017
    @est 你用的什么?
    mengskysama
        6
    mengskysama  
       Mar 31, 2017
    mysql-connector 生产环境 ok ,就是 connection pool 有点蠢 size 是死的不是很好处理,想要灵活连接池重用得自己写。
    simple2025
        7
    simple2025  
    OP
       Mar 31, 2017
    @mengskysama mysql-connector 到底是哪个库?
    ideascf
        9
    ideascf  
       Mar 31, 2017
    用 pymysql 才能和 gevent 配合
    VYSE
        10
    VYSE  
       Mar 31, 2017
    兼容的 MySQLdb 可以用豆瓣的 greenify+patch 后的 MySQLdb,不过貌似不维护了
    原来也用过 ultramysql,有坑也不维护了
    生产环境还是选 pure python 实现
    simple2025
        11
    simple2025  
    OP
       Mar 31, 2017
    @VYSE pymysql?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2464 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 06:05 · PVG 14:05 · LAX 23:05 · JFK 02:05
    ♥ Do have faith in what you're doing.