问题
Im developed a software and it's now time to test it connection to a online server. Im developing in C# using Visual Studio and I'm trying to connect to a MySQL server. To be specifc Im trying to connect to a test server at db4free server. I changed my ConnectionString to:
connectionString = "SERVER=db4free.net;PORT=3306;DATABASE=prpsystem;UID=database;PWD=password;";
But when I try to open the connection to check if the login is OK the visual studio shows this message error:
Guid should contain 32 digits with 4 dashes.
Do you guys know what is happening? Thanks for the help.
回答1:
Your crash is coming from Driver.LoadCharacterSets
, which is executing SHOW COLLATION. This is bug 92982 that has been reported against the Connector/NET driver.
According to the OP on that case, he fixed the problem by disabling the skip-character-set-client-handshake
setting in his my.cnf for MySQL Server. If you also have that setting, try disabling it to see if it resolves the problem.
Otherwise, you could switch to MySqlConnector, an alternate ADO.NET library for MySQL, which doesn't have this bug.
来源:https://stackoverflow.com/questions/53209369/c-sharp-with-mysql-error-guid-should-contain-32-digits-with-4-dashes-when-t