简体   繁体   English

如何在mysql c ++连接器中设置超时

[英]How to set timeout in mysql c++ connector

I am using c++ connector to connect to MySQL server. 我正在使用c ++连接器连接到MySQL服务器。 When server is offline or in sleep,the statement execute method takes a while to detect the connection problem. 当服务器脱机或处于睡眠状态时,语句执行方法需要一段时间才能检测到连接问题。
Is there a method or variable to control the waiting timeout period in client? 是否有方法或变量来控制客户端的等待超时时间?

Regards 问候
Devara Gudda 德瓦拉古达

You can use the mysql_options function to set the client timeout. 您可以使用mysql_options函数来设置客户端超时。 Full details here... http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html 这里有详细信息...... http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM