Good evening.
I cant get the Mysql Update Statement working. Maybe i am missing something.
The same mysqlconnection worked flawlessly to Select and Insert Data. FYI those sections(Select and Insert) are commented out.
I get following 4 error messages:
Full exception:
MySql.Data.MySqlClient.MySqlException
HResult=0x80004005
Message=Fatal error encountered during command execution.
Source=MySql.Data
StackTrace:
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at sqltest.Program.Main(String[] args) in C:\Users\chaos\Dropbox\Visual Studio\Mysqltest\sqltest\sqltest\Program.cs:line 35
Inner Exception 1:
MySqlException: Fatal error encountered attempting to read the resultset.
Inner Exception 2:
MySqlException: Reading from the stream has failed.
Inner Exception 3:
IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Inner Exception 4:
SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Thanks alot in advance
Two suggestions from me:
Have you tried creating the command like this? var cmd = new MySqlCommand(SQL_update, conn); after opening the connection, then doing the cmd.ExecuteNonQuery(); ?
Have you tried having the connection string looking like this instead? "SERVER=" + server + ";DATABASE=" + database + ";UID=" + username + ";PASSWORD=" + password;
... where "server" is ip/servername + port, like "myserver:3306". If server is local server, I THINK server can be "localhost" without port if the port is the standard port.
Ok guys... I thank everyone single one of you who tried to help me.
I found the error. The Mysql Server was running on Version 5.7.17. I did not update the server but installed the new version of Mysql Benchmark instead on the Windowsserver 2012. I can not open the new Benchmark but it fixed the communication Problem.
I have no clue whatsoever why certain statements did work (Insert, Select) but UPDATE did not.
User contributions licensed under CC BY-SA 3.0