By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

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

P: 1
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=localhost;database=mydb;uid=root;password= admin";

what change i do?
May 3 '13 #1
Share this Question
Share on Google+
2 Replies


pod
100+
P: 298
pod
start by changing the server parameter in your connection string for a fully qualified path to the machine your database resides;

string connectionpath = "server=\\computername\folder; database=mydb; uid=root; password= admin";
Jun 5 '13 #2

Frinavale
Expert Mod 5K+
P: 9,731
@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
Jun 6 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Browse more .NET Framework Questions on Bytes