Link to home
Start Free TrialLog in
Avatar of tangteng78
tangteng78Flag for Malaysia

asked on

How to connect to external data server on MySQL using .NET?

I want to separate my database to be in a separate data server. Below is the current connection string on my local database (it's a working one).
<add name="MySqlConn" connectionString="Database=kudodb;Data Source=localhost;User Id=root;Password=root;charset=utf8" providerName="System.Data.MySql"/>

I'd tried on below and it's not working (xxx.xx.xx.xx = data server ip address).
<add name="MySqlConn" connectionString="Database=kudodb;Data Source=xxx.xx.xx.xx,3306;User Id=root;Password=root;charset=utf8" providerName="System.Data.MySql"/>

Any idea? Do i need to set permission also on the MySQL database?
Avatar of tangteng78
Flag of Malaysia image


And i get the error message below on the connection string below:
 <add name="MySqlConn" connectionString="Database=kudodb;Data Source=xxx.xx.xx.xx; Port =3306;User Id=root;Password=root;charset=utf8" providerName="System.Data.MySql"/>
 Error Message:
Access denied for user 'root'@'' (using password: YES) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'@'' (using password: YES)
Error simply states that password supplied for user root is not matching with that of stored in grant tables...

Pls create a user account on the MySQL server..
Avatar of Umesh
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you try?