HResult=0x80131501 on my new Win11 32bit machine
Posted by: Jon Jacobs
Date: April 25, 2024 11:13AM

This the closest match I could find to post my query, although connector is not explicit in the code. Note: ctor in code below refers to the constructor.
When I login to MySQL 8.3 Command Line Client, I get no error. The connection works fine in HeidiSQL also. When I run my code programatically I get the error.
Message=A call to SSPI failed, see inner exception.
Inner Exception 1:
Win32Exception: The message received was unexpected or badly formatted
Here is the code:
public void MakeConnection()
string connectionstring = "Server=localhost; UID=root; Pwd=<mypassword>; Database=MyDatabase;";
con = new MySqlConnection(connectionstring);
if (con == null) return;
cmd = con.CreateCommand();
It throws the error at con.Open(); Interestingly, when I run the exact same code on my Win 8.1 32bit machine, I get no error. Obviously a different instance of MySQL, since both are localhost.
The password is NOT misspelled. Re-typed numerous times in program and command line to be sure.
Here is the stack trace for the error in case that helps:
at MySql.Data.Common.Ssl.StartSSL(Stream& baseStream, Encoding encoding, String connectionString)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at DB.BaseDB.MakeConnection() in C:\Users\jonqj\Projects\DB\BaseDB.cs:line 112
at DB.BaseDB..ctor(String cns) in C:\Users\jonqj\Projects\DB\BaseDB.cs:line 100
at MYSQL.MySQL..ctor(String cns) in C:\Users\jonqj\Projects\MYSQL\MySQL.cs:line 14
at ConsoleApp1.Program.Main(String[] args) in C:\Users\jonqj\Projects\ConsoleApp1\Program.cs:line 12

I am in the process of migrating lots of stuff from my win 8.1 machine to my win 11 machine.
What can I do to make this work? Thank you.

Options: ReplyQuote

Written By
HResult=0x80131501 on my new Win11 32bit machine
April 25, 2024 11:13AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.