Connecting to MySQL from VB.net version 8.0.28
SolvedPutoisSplendide90 Posted messages 23 Status Membre -
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
3 réponses
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