Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想了解 MySqlCommand CommandTimeout 。如果为零,是否意味着“无限期”?
根据官方文档,似乎 0 意味着无限期。
默认值为 30 秒。值 0 表示无限期等待,应该避免。请注意,可以使用连接字符串选项 Default Command Timeout 更改默认命令超时。
(强调我的)
但是, 2006 年 10 月的这篇文章似乎表明并非如此。自从发布该帖子以匹配官方文档以来,很可能已经修改了实现。最好的办法是试一试,看看会发生什么:)