hit9
V2EX  ›  问与答

travis测试mysql和python时,发现连接数据库很慢。我需要修改连接数据库的代码么

  •  
  •   hit9 · Jan 6, 2013 · 2921 views
    This topic created in 5054 days ago, the information mentioned may be changed or developed.
    目前使用的代码是
    https://gist.github.com/4465333

    以前测试的时候还出过OperationError 2006的异常。

    但是本机测试挺好啊。。
    2 replies  •  1970-01-01 08:00:00 +08:00
    hit9
    hit9
    OP
    Jan 6, 2013
    1
    我发现了瓶颈。在drop table语句
    hit9
    hit9
    OP
    Feb 10, 2013
    2
    结束下这个帖子。问题在没有设置 autocommit为 True 。

    即 travis的worker上的mysql是默认不打开autocommit
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   515 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:29 · PVG 05:29 · LAX 13:29 · JFK 16:29
    ♥ Do have faith in what you're doing.