4
通过python连接时,如何更改默认的Mysql连接超时?
我使用python连接到mysql数据库con = _mysql.connect('localhost', 'dell-pc', '', 'test') 。我编写的程序需要大量时间才能完全执行,即大约需要10个小时。实际上,我正在尝试从语料库中读取不同的词。读取完成后,出现超时错误。 我检查了Mysql默认超时是: +----------------------------+----------+ | Variable_name | Value | +----------------------------+----------+ | connect_timeout | 10 | | delayed_insert_timeout | 300 | | innodb_lock_wait_timeout | 50 | | innodb_rollback_on_timeout | OFF | | interactive_timeout | 28800 | | lock_wait_timeout | 31536000 | | net_read_timeout | 30 | …