question

StefanoMora-1017 avatar image
0 Votes"
StefanoMora-1017 asked StefanoMora-1017 edited

C# 'The handshake failed due to an unexpected packet format.' exception opening MariaDb database

Hi all,
I'm writing a WPF C# program.

I need to connect to a MariaDB (10.4.21) database: the Open() function always breaks with IOException and the message 'The handshake failed due to an unexpected packet format.'.
The connection string is: "server=localhost;user id=root;persistsecurityinfo=True;port=3306;database=mydb;pwd=pass"
and it is copyAndPasted from VS2019 server explorer window.

VS2019 installed the 'MySQL for Visual Studio' extension 1.2.9.

I don't use SSL.

The connection inside the VS2019 is OK.
The connection on command line is OK.
The connection with HeidiSQL is OK.

Any idea?
thanks

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

StefanoMora-1017 avatar image
0 Votes"
StefanoMora-1017 answered StefanoMora-1017 edited

After a lot of retries I switched to MySQL and now I have no more problems.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.