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
chenqh
V2EX  ›  Python

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

  •  
  •   chenqh · 2017-03-31 09:20:21 +08:00 · 4165 次点击
    这是一个创建于 2577 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Mysqldb这个库好像不支持异步
    如果都用的是这个库的话,不支持也没有办法。。
    我也只能用 Mysql-python
    
    
    11 条回复    2017-03-31 14:27:54 +08:00
    KIDJourney
        1
    KIDJourney  
       2017-03-31 09:42:19 +08:00
    不用 pymysql 不能 patch 吧。
    Zuckonit
        2
    Zuckonit  
       2017-03-31 09:47:21 +08:00
    官方的 mysql-connector 吧,生产环境用了很长时间了
    chenqh
        3
    chenqh  
    OP
       2017-03-31 09:48:14 +08:00
    @KIDJourney 你是用的 pymysql ?有没有出什么问题?
    est
        4
    est  
       2017-03-31 10:41:24 +08:00
    chenqh
        5
    chenqh  
    OP
       2017-03-31 10:54:09 +08:00
    @est 你用的什么?
    mengskysama
        6
    mengskysama  
       2017-03-31 10:57:50 +08:00
    mysql-connector 生产环境 ok ,就是 connection pool 有点蠢 size 是死的不是很好处理,想要灵活连接池重用得自己写。
    chenqh
        7
    chenqh  
    OP
       2017-03-31 11:25:44 +08:00
    @mengskysama mysql-connector 到底是哪个库?
    dsg001
        8
    dsg001  
       2017-03-31 13:09:31 +08:00
    ideascf
        9
    ideascf  
       2017-03-31 13:16:37 +08:00
    用 pymysql 才能和 gevent 配合
    VYSE
        10
    VYSE  
       2017-03-31 14:23:13 +08:00
    兼容的 MySQLdb 可以用豆瓣的 greenify+patch 后的 MySQLdb,不过貌似不维护了
    原来也用过 ultramysql,有坑也不维护了
    生产环境还是选 pure python 实现
    chenqh
        11
    chenqh  
    OP
       2017-03-31 14:27:54 +08:00
    @VYSE pymysql?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2713 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:38 · PVG 13:38 · LAX 22:38 · JFK 01:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.