- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一些代码来支持 alexa 前端。
它在 Rpi 上运行,它是 python 查询 mysql 数据库,flask-ask 等。
它一整天都完美运行,第二天早上我收到错误 2006(mysql 已消失)错误,必须重新启动 python 脚本。
我检查了我的配置和 connect_timeout = 10。
我假设这是几个小时,但似乎被定义为秒....所以我不明白我的代码是如何整天工作的,只有在晚上 sleep 后才会失败。我当然不会每 10 秒运行一次查询。
我找到了 ping 命令并想尝试它来重新建立连接,但是如果每次测试之间必须上床 sleep ,测试会有点痛苦,所以我真的想将超时设置为 10 秒这样我就可以随意重现错误并测试 ping。
有什么线索可以让它在几秒后超时吗?
最佳答案
mysql中有很多不同的超时参数,例如:
The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake.
The execution timeout for SELECT statements, in milliseconds. If the value is 0, timeouts are not enabled.
The number of seconds the server waits for activity on an interactive connection before closing it.
The number of seconds the server waits for activity on a noninteractive connection before closing it.
您需要调查哪个超时导致您的用例出现问题,并相应地进行修改。根据您对问题的描述,您解释说在您的脚本休眠时连接在一夜之间丢失,它可能是 wait_timeout
(或 interactive_timeout
,具体取决于您的连接是如何启动的).
关于python - 与我的 MYSQL connect_timeout 单位混淆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54152248/
有什么区别: mysql.connect_timeout 我们可以在 php.ini 中找到 和 connect_timeout 属于 mysql 配置(显示变量)。 知道apache serve
Guzzle 中的“connect_timeout”和“timeout”请求选项有什么区别。 最佳答案 我可以解释的最基本的方法是(据我了解): 连接超时 - Time Guzzle 将等待与服务器建
我有一些代码来支持 alexa 前端。 它在 Rpi 上运行,它是 python 查询 mysql 数据库,flask-ask 等。 它一整天都完美运行,第二天早上我收到错误 2006(mysql 已
我正在尝试在 kubernetes 上部署一个自动化的高可用 PostgreSQL 集群。在 master 故障转移或 master 临时故障的情况下,standby 丢失流复制连接,并且在重试时,它
Perl 新手在这里。我有一行代码: my $api_data = decode_json( $ua->get($url)->res->body ); 哪里$ua = Mojo::UserAgent-
我最近收到一条评论,说我应该“在我的脚本中使用 connect_timeout”。我去搜索这实际上意味着什么,我在 php.net 上找到了这个信息。在用户评论中: One thing is to r
网络上有很多文章和 StackExchange 上的答案都建议使用类似这样的行(甚至更长的超时)来避免长时间运行的进程中 MySQL 超时的错误(例如但不限于“MySQL 服务器已经消失了”): in
我们有一个美味的 mysql master + master setup 正在运行。 这对解决我们一直遇到的 innodb 的一些奇怪问题有很大帮助。但这是另一个问题... 为了进一步优化这个 mys
我刚刚通过 cocoapods 更新到 Xcode 9.4 (Swift 4.1) 和 Realm 3.6.0。我第一次收到编译器“语义问题”警告: Enumeration values 'conne
我们最近移植了一些代码,我们必须使用 PHP 的 MySQLi 扩展而不是常规的 mysql。此代码连接到偶尔可能没有响应的数据库,因此我们在 PHP.ini 上设置此变量: mysql.connec
为了在进行 REST 调用时设置超时,我们应该指定这两个参数,但我不确定为什么要同时指定这两个参数以及它们究竟有什么不同的用途。另外,如果我们只设置其中一个或两个设置不同的值怎么办? 最佳答案 CON
我是一名优秀的程序员,十分优秀!