问题描述
我从SQL Server 2005中使用ASP.NET的MVC转换我的数据库到MySQL。
I am converting my database from SQL Server 2005 to MySQL using asp .net mvc.
我在SQL服务器(400K记录)大量数据,但我面对的命令超时/等待的CommandTimeout
,当我在谷歌搜索,可以给出错误65535作为其最高值或0(如果它应该等待无限长的时间)。
I have bulk data in SQL Server (400k records), but I am facing command timeout/waiting for CommandTimeout
error which, when I search on Google, can be given 65535 as its highest value or 0 (if it should wait for unlimited time).
这两个不是为我工作。我还设置任何 ConnectTimeout
180。所以,我应该去改变它呢?谁曾面临这个问题或任何人有任何证实的知识,请分享一下。
Both of these aren't working for me. I also have set any ConnectTimeout
to 180. So should I have to change it too? Anybody who had faced this problem or have any confirmed knowledge please share.
推荐答案
对于我来说增加的CommandTimeout固定的问题。
For me increasing the CommandTimeout fixed the issue.
code样品:以秒为单位
Code sample:
//time in seconds
int timeOut = 300;
//create command
MySqlCommand myCommand = new MySqlCommand(stringSQL);
//set timeout
myCommand.CommandTimeout = timeOut;
这篇关于MySQL命令超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!