Problem of connection

Cyril
2003-03-02
2004-01-03
  • Cyril

    Cyril - 2003-03-02

    Hy everybody,

    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.

    Bye
    DoooD

    PS : Excuse for my english, i'm french, sorry

     
    • charles candy

      charles candy - 2003-06-10

      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

       
    • Robert Hammond

      Robert Hammond - 2003-07-11

      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?

       
    • Frode Lillerud

      Frode Lillerud - 2003-12-30

      Same problem here!

      I tried this code:
      MySQLConnection con; con = new MySQLConnection( new MySQLConnectionString("10.0.0.4","database","user","pwd").AsString );
      con.Open();

      but get an exeption saying:
      Error: can't connect.Access denied for user:'root@10.0.0.3', 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.

       
    • Bryce Kahle

      Bryce Kahle - 2004-01-03

      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.

       
    • Bryce Kahle

      Bryce Kahle - 2004-01-03

      The reason it is reporting access denied for user: 'root@10.0.0.3' 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.

       

Log in to post a comment.