Connecting to MySQL from VB.net version 8.0.28
SolvedPutoisSplendide90 Posted messages 23 Status Member -
Hello,
I have been trying to connect to my database from VB.net for a while now and I am getting the following error:
SSPI call failed, check the inner exception
However, with the same credentials, I am able to connect via command line from MySQL.
Here is my VB code:
Conn = new Mysqlconnection ("SERVER=localhost; PORT=3306; UID= root; PWD=monpasse") Try If conn.state= connectionState.close then Conn.open Messagebox.show(ok) End if Catch ex as exception Messagebox.show(ex.message) End try
- [VB.NET] Select entire line ListView
- changing language in vb.net
- Retrieve the result of a SELECT (VB.net)
- VB.net program does not start
- Éteindre le PC avec VB.NET peut être effectué en utilisant la commande suivante : ```vb Process.Start("shutdown", "/s /t 0") ```
- I cannot install .NET Framework 4.8 on Windows 10
3 answers
-
Hello,
I just have some observations on the connection string to the database.
There's a space before root. The name of the database is missing. I would put the parameter names in lowercase.
("server=localhost; port=3306; uid=root; pwd=mypassword; database=test")
Also test the port with the server name
("server=localhost:3306; uid=root; pwd=mypassword; database=test")
-
Thank you for your response
There was no spacing either in front of Root or in front of my password, or the server name; I tried again by adding a space but without success
The DATABASE parameter is indeed in my instruction; I forgot to mention it in my first post
I also tried the parameter you gave me localhost:3306 and still the same error message
-
Hello,
I was able to address this issue by executing the command SslMode = None in the connection instruction,
Well, I still don't know what the advantages and disadvantages of this parameter are, but for now my code is working
Thank you