I have two computers one (The Server) is installed with MySQL and Server and it contains the database. The other (Client) want to access the the database using c#
I have google and found that i also need to install the MySQL Connector for this. But i wasn’t able to get any database. I have tried several examples but it won’t work either it says that can’t connect to the database or just blank screen.
And if i try the same code on the server using IP as localhost then it works fine.
Firewall is disabled on both computers and yes i am using the mysql root account and giving the username, password and the ip address from the client. but still nothing happens.
How are the computers connected? Through a router? Make sure the port is forwarded properly. Through your ISP? Make sure they don’t block the port you need.
As someone mentioned, you really need to check with your ISP, they are know to block certain ports. That, or Anit-Virus/Firewall.
EDIT:
It is also possible, if you have different servers/programs, could also block the port. I had a hell of a time with Apache and IIS working together. As a matter of fact, I could never get them to work with each other. It was one or the other. Just another possibility if you use multiple database/server’s on your box.
^^^that rarely is a problem with database servers. Unlike web servers – who all want the same port (80), the DB server ports are app specific and most vendors make their server’s not mess with other people’s. Unless you do something like make Sql Server listen on 3306 . . .
The computers are connected to a wireless router and they also ping each other. I was googling more for the problem then i see a post at the forum that says to connect with the cpanel containing the database. I used the following code
namespace MySqlExample
{
class Program
{
static void Main(string args)
{
string host = “173.192.219.168”;
string database = “jeunefil_test”;
string user = “jeunefil_test”;
string password = “test123”;
string strSQL = “SELECT * FROM checker”;