title: MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts
body: <p>I am running a script which takes around 45 mins. The script interacts with MySQL multiple times in between but at the end the script got stopped and generated following error:</p>
  
  <pre><code>MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified           MySQL hosts. ---&gt; System.Net.Sockets.SocketException (0x80004005): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
  at System.Net.Sockets.Socket.DoBeginConnect(EndPoint endPointSnapshot, SocketAddress socketAddress, LazyAsyncResult asyncResult)
  at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
  at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySqlConnectionStringBuilder settings, IPAddress ip, Boolean unix)
  at MySql.Data.Common.MyNetworkStream.CreateStream(MySqlConnectionStringBuilder settings, Boolean unix)
  at MySql.Data.Common.StreamCreator.GetStream(MySqlConnectionStringBuilder settings)
  at MySql.Data.MySqlClient.NativeDriver.Open()
  at MySql.Data.MySqlClient.NativeDriver.Open()
  at MySql.Data.MySqlClient.Driver.Open()
  at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
  at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
  at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
  at MySql.Data.MySqlClient.MySqlPool.GetConnection()
  at MySql.Data.MySqlClient.MySqlConnection.Open()
  at Connection.ExecuteNonQuery(String str)
  at BulkEmailSender.Program.Main(String[] args)
  </code></pre>
  
  <p>The script was able to connect multiple times than what could have happened?</p>