Fail to open connection to MySQL with physical ip.
Posted by: Joe Hsu
Date: June 18, 2013 06:11PM

My program and MySQL are in the same machine.
I used the ip of the local area connection (physical ip) and root account to open mysql connection, as follows.

================================================
string connStr = "server=10.36.63.202;uid=root;pwd=123";
MySqlConnection conn = new MySqlConnection(connStr);
try
{
conn.Open();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{ // Got error code: 1045 }
================================================

I always got the error code 1045. (invalid username and password)
If I changed server to "localhost" or "127.0.0.1", it always worked.
If I used this root account to open mysql in command line (mysql -u root -p), it always worked too.
Why couldn't I use physical ip to open mysql connection?
Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Fail to open connection to MySQL with physical ip.
June 18, 2013 06:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.