1

I have my connection string set as

<add name="myconn" connectionString="server=192.X.Y.Z;user id=myusername;persistsecurityinfo=False;database=mydatabasehere;port=3306;Password=mypassword;" providerName="MySql.Data.MySqlClient" />

and later this error appear:

An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll but was not handled in user code

Additional information: Authentication to host '192.X.Y.Z' for user 'myusername' using method 'mysql_native_password' failed with message: Access denied for user 'myusername'@'crlspr-myipaddresshere.myacc.net' (using password: NO)

What will be the problem of this exception? my connection seems to be ok since I just tested from MySQL Workbench as well in Visual Studio * Server Explorer

Why the error message get my ipaddress, 'myusername'@'crlspr-myipaddresshere.myacc.net'? maybe is a firewall problem.

2
  • Does this help: stackoverflow.com/a/10096698/188331 ? Commented Feb 10, 2015 at 6:20
  • no. I try a couple of those and I find similar result or keyword not supported. But thanks you, because I am now sure is the connection string. Commented Feb 10, 2015 at 15:21

1 Answer 1

0

Since my problem was the DB connection string and I was not sure which one @Raptoy suggestion will work or not, Then I went to MySQL website and get one of their example 4.14.2 Usage: Creating A New MVC Web Application and the connection string that was generated by the wizard finally works:

<add name="myconn" connectionString="server=192.X.Y.Z;user id=myusername;password=mypassword;persistsecurityinfo=True;database=mydatabasehere" providerName="MySql.Data.MySqlClient" />

You will notice the connection string contains:

  • server
  • user id
  • password
  • persistsecurityinfo=True
  • database
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.