Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why cannot access to mysql server remotely?

Status
Not open for further replies.

alan123

MIS
Oct 17, 2002
149
US
I tried to access to mysql server remotely but it fails, it shows error message "lost connection", the mysql server runs fine, on local machine, I find that I can only use "localhost" to connect db, I cannot use hostname or IP address locally to instead of "localhost", I have no clue what cause this issue, I also tried to change hostname to "%" in db user table, but it show the same error, can anyone help me to get this problem fixed? thanks a lot.
 
Mysql runs on RH8.0, right now I can connect to mysql server locally either by "localhost" or "machine's hostname"(this will resolve to 127.0.0.1), however it doesn't work if I use host's IP address (lost connection), is there somewhere I need to resolve IP addrss to hostname?
need help...
 
What is the output if you run the following?

USE mysql;

SELECT host, user FROM user;

Your database could be only allowing connections for user 'root' on host 'localhost'
 
here is what I have in "select host, user from user"
------
mysql> select host, user from user;
+-------------+------------+
| host | user |
+-------------+------------+
| % | root |
| % | vstream |
| % | vstream1 |
| % | vstream3 |
| 199.4.120.4 | vstream1 |
| 199.4.120.4 | vstream2 |
| localhost | |
| localhost | access_log |
| localhost | root |
+-------------+------------+
11 rows in set (0.00 sec)

mysql>

-------
I created accounts for testing, but always see "lost connection" expect use "localhost", if I use IP to access locally:
#telnet 199.4.120.4 3306
Trying 199.4.120.4...
Connected to 199.4.120.4.
Escape character is '^]'.
Connection closed by foreign host.

don't know why? need help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top