How Can I Connect my C#.net desktop application to the MYSQL server of another PC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vimesh93
    New Member
    • May 2013
    • 1

    How Can I Connect my C#.net desktop application to the MYSQL server of another PC

    currently i made C#.net application with MYSQL database connectivity. here it runs completely in my pc means in localhost.

    But Now i want to move my database on other computer and doing same thing which is working with my localhost....

    in short i want to connect my application with Remote MYSQL server

    So What should i do????

    my connection string is below

    string connectionpath = "server=localho st;database=myd b;uid=root;pass word=admin";

    what change i do?
  • pod
    Contributor
    • Sep 2007
    • 298

    #2
    start by changing the server parameter in your connection string for a fully qualified path to the machine your database resides;

    string connectionpath = "server=\\compu tername\folder; database=mydb; uid=root; password= admin";

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      @Pod's answer is correct, all you have to do is change the server location section in the connection string to point to the database location.

      Please note that if the database is not on your local network, or if your local network does not support name resolution, you should use the IP address of the server hosting the database.

      -Frinny

      Comment

      Working...