TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jim Tat
NA
52
47k
How to connect to a remote MySQL server using C#?
Oct 27 2016 10:36 AM
I have a C# Application which would access a MySQL server using WAMP on another computer. I am trying to do it via IP. Here is my Connection String :
server =
"192.168.10.221"
;
database =
"restaurantdb"
;
uid =
"root"
;
password =
""
;
string
connectionString;
connectionString =
"SERVER="
+ server +
"; PORT = 3306 ;"
+
"DATABASE="
+ database +
";"
+
"UID="
+ uid +
";"
+
"PASSWORD="
+ password +
";"
;
mycon =
new
MySqlConnection(connectionString);
I have another computer in which we are in the same network, but when I try to connect to the Mysql I am not able to connect but locally it works...
What do you think ?
What I have tried:
I published my C# application and then launch it in the other computer so that I will try to connect to mysql but nothing works. But I have to mention that when I put the ip adress in the other computer I can have access to wampserver and phpmyadmin ...
I got this error: .MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
Reply
Answers (
1
)
How to Clone a Class instance without reference?
Help in decision for C# development.