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

Stefano Mora 1 Reputation point

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?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,139 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Stefano Mora 1 Reputation point

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

    0 comments No comments