0

Hi

I am using C# to connect to mysql database that install in my local machine.After I complete the project I want to publish it in another server.So I change the mysql connection string.Here I mention the
connection string that I used in local machine

String MyConString = "SERVER=localhost;"+"DATABASE=IPG;"+"UID=root;"+"PASSWORD=Test;";

Before publich into server,I change connection string as below

String MyConString = "SERVER=10.2.0.212;"+"DATABASE=IPG;"+"UID=root;"+"PASSWORD=Test;";

But that time its not connect to database.I use IP adreess instead of localhost.Please help me.

Thanks

Edited by Tank50: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Tank50
0

Hi

I am using C# to connect to mysql database that install in my local machine.After I complete the project I want to publish it in another server.So I change the mysql connection string.Here I mention the
connection string that I used in local machine

String MyConString = "SERVER=localhost;"+"DATABASE=IPG;"+"UID=root;"+"PASSWORD=Test;";

Before publich into server,I change connection string as below

String MyConString = "SERVER=10.2.0.212;"+"DATABASE=IPG;"+"UID=root;"+"PASSWORD=Test;";

But that time its not connect to database.I use IP adreess instead of localhost.Please help me.

Thanks

Hi,
You need to create the global user account on mysql as follows.

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'Test';

GRANT ALL PRIVILEGES ON *.* TO '<Username>'@'%' WITH GRANT OPTION;

After that set the connection string with this username and password. It will work. Otherwise let me know.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.