difference between "localhost" and "127.0.0.1"??
Hi to all!
I have a web server with mysql which to I access via ssh from remote computer. There is also a router with firewall ON and open ports that I need between remote comp and this web server. Now, I am trying to access to mysql database via MySQL Workbench and I cannot connect to it. Therefore, I've logged into my server via ssh from my remote comp and checked open ports with nmap. Now after nmapping server's ip I see there is not opened 3306 port: Code:
X@staufenberg:~$ nmap -v 192.168.123.103 Code:
x@staufenberg:~$ nmap -v localhost Sincerely, Marko |
Uhm, looking at your logs, localhost and 127.0.0.1 ARE the same on your machine. By convention, localhost always maps to the local loopback interface, configured for IPv4 address 127.0.0.1 (and possibly IPv6 address ::1).
But, it's NOT that same as the REAL ethernet interface of your box, as you can see in the first log. The 192.168.x.x IP address is given to your real network card, while "local loopback" is always a virtual network card and not connected to the outside world. MySQL by default only binds to the loopback interface, for security reasons. You can probably change this behavior in your "my.cnf" (I don't remember the syntax). If you want to get an overview of all your network interfaces, try typing "ifconfig" :) |
Hi,
Have a look at your /etc/hosts file. 127.0.0.1 / localhost.localdomain / localhost are the same and mapped to each other. There should also be one or more lines that name your other IP's (something like: 192.168.123.103 myip1.domain.com myip1). If you use a name (like localhost or myip1 in the previous example), this is translated first to the connected ip address. localhost will become 127.0.0.1 and myip1 will become 192.168.123.103. Hope this helps. |
Quote:
Code:
x@staufenberg:~$ ifconfig -a Sincerely, Marko |
Marko, your mysql daemon is just not listening on eth0. You have to adjust its configuration if you want that.
|
Quote:
|
As I already said, edit your "my.cnf" file, that's the main configuration for the mysql daemon.
|
now, I fixed that, but now I have following problem: I can connect to mysql server via terminal window using my account, but with MySQL Workbench I cannot connect using same account, I get:
Quote:
|
the difference ?
one is a number the other is text other than that -- the same for all practical reasons |
All times are GMT -5. The time now is 02:23 AM. |