I have tried mysqldrivercs with C# and mysql database. It works but only if mysql is installed on the machine that's to say "localhost". When i connect, i use :
MySQLConnection con = new MySQLConnection( new MySQLConnectionString( "localhost","test","root","").asString );
But if i want to connect on server linux with Mysql, i can't, for this i change localhost by address IP of the server ; for example 192.168.0.5
MySQLConnection con = new MySQLConnection( new MySQLConnectionString( "192.168.0.5","test","root","").asString );
And it doesn't work, impossible to connect although Mysql server is ok, it runs fine but impossible to connect with C#. I also tried with mysql installed on a different pc with Windows and it doesn't work too.
So, if anyone know to connect on a server with mysql, it would be great to share the answer.
Thanks in advance.
PS : Excuse for my english, i'm french, sorry
first of all you need to make sure u can access(no connectivity problem) from mysql client to mysql server. for how to establise conection please read the mysql manual
I have this same problem. I have verified that I have the correct permissions. Connection works from the command line mysql and from MySQL Control Center, both using the exact same info as my connection string. Has anyone figured this out?
Same problem here!
I tried this code:
MySQLConnection con; con = new MySQLConnection( new MySQLConnectionString("10.0.0.4","database","user","pwd").AsString );
but get an exeption saying:
Error: can't connect.Access denied for user:'firstname.lastname@example.org', etc.
The strange this is that I'm trying to connect to 10.0.0.4, but it reports back 10.0.0.3 (localhost).
Seems to me like MySQLDriverCS has a problem working with remote MySQL servers.
I posted this on the other post as well, but the root user is setup by default to only be allowed to connect from localhost. You can create other users to access the MySQL server from anywhere using the % wildcard character in the host field.
The reason it is reporting access denied for user: 'email@example.com' is because users in MySQL are a combination of the username, and the hostname or IP address they are connecting from. When you create users in MySQL you can limit where they can connect from using the GRANT command.
lookup the GRANT command on mysql.com to learn more about creating users in MySQL.