Home > database >  Mysql regular newspaper Reading from the stream has failed.
Mysql regular newspaper Reading from the stream has failed.

Time:10-30

Links to.net mysql library, every day to receive the following error:
 
The 2017-05-05 11:03:41. 0596 [3] ThreadID: Error: an Error occurred.
2017-05-05 11:03:41. 0752 [3] ThreadID: Error: MySql. Data. MySqlClient. MySqlException x80004005 (0) : Reading from the stream has failed. - & gt; System. IO. IOException: unable to read data from the transport connection: the remote host forced to shut down an existing connection, and - & gt; System.Net.Sockets.SocketException: remote host forced to shut down an existing connection,
In System.Net.Sockets.Socket.Receive (Byte [] buffer, Int32 offset, Int32 size, SocketFlags SocketFlags)
In System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size)
- at the end of the inner exception stack trace -- -- --
In MySql.Data.Com, mon. MyNetworkStream. HandleOrRethrowException (Exception e)
In MySql.Data.Com, mon. MyNetworkStream. Read (Byte [] buffer, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. TimedStream. Read (Byte [] buffer, Int32 offset, Int32 count)
In the System. IO. BufferedStream. Read (Byte [] array, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. MySqlStream. ReadFully (Stream, Stream, Byte [] buffer, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. MySqlStream. LoadPacket ()
In MySql. Data. MySqlClient. MySqlStream. LoadPacket ()
In MySql. Data. MySqlClient. MySqlStream. ReadPacket ()
In MySql. Data. MySqlClient. NativeDriver. The Open ()
In MySql. Data. MySqlClient. Driver. The Open ()
In MySql. Data. MySqlClient. Driver. The Create (MySqlConnectionStringBuilder Settings)
In MySql. Data. MySqlClient. MySqlPool. CreateNewPooledConnection ()
In MySql. Data. MySqlClient. MySqlPool. GetPooledConnection ()
In MySql. Data. MySqlClient. MySqlPool. TryToGetDriver ()
In MySql. Data. MySqlClient. MySqlPool. GetConnection ()
In MySql. Data. MySqlClient. MySqlConnection. The Open ()
In MySql. Data. MySqlClient. MySqlHelper. ExecuteDataset (String the connectionString, String commandText, MySqlParameter [] commandParameters)
In TestMysql. TestProcess. GetCountDayList (position) e: \ TFSROOT \ test \ TestMysql \ TestMysql \ TestProcess cs: line number 365
In TestMysql. TestProcess. Process (position) e: \ TFSROOT \ test \ TestMysql \ TestMysql \ TestProcess cs: line number 61
Position in TestMysql. TestProcess. The Run () e: \ TFSROOT \ test \ TestMysql \ TestMysql \ TestProcess cs: line number 43
The 2017-05-05 11:03:41. 0752 [3] ThreadID: Error: InnerException:
The 2017-05-05 11:03:41. 0752 [3] ThreadID: Error: System. IO, IOException: unable to read data from the transport connection: the remote host forced to shut down an existing connection, and - & gt; System.Net.Sockets.SocketException: remote host forced to shut down an existing connection,
In System.Net.Sockets.Socket.Receive (Byte [] buffer, Int32 offset, Int32 size, SocketFlags SocketFlags)
In System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size)
- at the end of the inner exception stack trace -- -- --
In MySql.Data.Com, mon. MyNetworkStream. HandleOrRethrowException (Exception e)
In MySql.Data.Com, mon. MyNetworkStream. Read (Byte [] buffer, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. TimedStream. Read (Byte [] buffer, Int32 offset, Int32 count)
In the System. IO. BufferedStream. Read (Byte [] array, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. MySqlStream. ReadFully (Stream, Stream, Byte [] buffer, Int32 offset, Int32 count)
In MySql. Data. MySqlClient. MySqlStream. LoadPacket ()
The 2017-05-05 11:03:41. 0908 [3] ThreadID: Error: InnerException:
The 2017-05-05 11:03:41. 0908 [3] ThreadID: Error: System.Net.Sockets.SocketException x80004005 (0) : the remote host forced to shut down an existing connection,
In System.Net.Sockets.Socket.Receive (Byte [] buffer, Int32 offset, Int32 size, SocketFlags SocketFlags)
In System.Net.Sockets.NetworkStream.Read (Byte [] buffer, Int32 offset, Int32 size)



Use link string:
 



CodePudding user response:

Look at the mysql error log

CodePudding user response:

Also struggling with this problem, the service side is no problem, haven't found a way to reproduce
If the original poster has a weight problem method, can be made

CodePudding user response:

No see error log and the related errors,

CodePudding user response:

@ ZJCXC this is accidental phenomenon, it is difficult to the inevitable, suspected to be connected and the connection pool at present

CodePudding user response:

Try net_write_timeout Settings

CodePudding user response:

https://www.cnblogs.com/CtripDBA/p/9778351.html
Someone found the problem, related to the mysql connection timeout,
Method 1: modify the mysql configuration file. My CNF, new connect_timeout=60
10 seconds, by default increased to 60 seconds,
Method 2: modify the driver source code, the article is doing just that
  • Related