C# with MySQL - Error: “Guid should contain 32 digits with 4 dashes” when trying to open the connection

对着背影说爱祢 提交于 2020-03-26 00:52:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!