Connecting to MySQL from VB.net version 8.0.28

Solved
Kff -  
PutoisSplendide90 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


3 answers

  1. jee pee Posted messages 9437 Registration date   Status Moderator Last intervention   9 973
     

    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")


    0
  2. PutoisSplendide90 Posted messages 23 Status Member 3
     

    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

    0
  3. PutoisSplendide90 Posted messages 23 Status Member 3
     

    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

    0