Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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.

share|improve this question
    
Does this help: stackoverflow.com/a/10096698/188331 ? – Raptor Feb 10 '15 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. – Jaider Feb 10 '15 at 15:21

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.