MySQL Connection Error

Hi,
I’m trying to connect to my local mysql server, but I only get the error

This is my code (JavaScript):

var dbcon : IDbConnection;
var connectionString : String =
"Server = localhost;"+
"Database=mydb;" +
"User ID = root;"+
"Password=pass;";
dbcon = new SqlConnection(connectionString);
dbcon.Open();

I turned off the firewall and I have my local MySQL server running with the information correct.
I googled this a lot, but I couldn’t find any answers.
What could be the solution? Thanks in advance for any help.

i think you are missing the port number too to add to your connection string

I also tried with “port = 3306” but it gave an error like “Unknown command : port”.

But anyways, I used a .php script and WWWForm instead of connecting to MySQL directly from Unity. It worked out for me.