Hello, I have a fresh Debian 12 Server and I just configure now using automated ISPConfig script, everything works fine except that I now notice that I get ERROR: 2005 (HY000): Unknown server host '127.0.0.1 when I tried dto connect on the terminal using mysql -u root -p, however I am able to connect using mysql -h localhost -u root -p. Any clue as to why 127.0.0.1 is not recognised? I have other older servers (all Debian 12 but not the latest ISPConfig) and they don't have this issue. Thanks for your helps.
No it is still there, this is what puzzles me. Also when i do netstat -tap, I don't see 127.0.0.1..., I only see 0.0.0.0... or localhost.localdomain... or the public servername.... for all processes.
o.o.o.o is fine, it means all IP addresses incl. 127.0.0.1. I wonder why it says '127.0.0.1 with just one quote at the beginning. maybe you quoted the value wrong and missed the closing quote? Try to remove all quotes, 127.0.0.1 does not need to be quoted.
I don't understand the single quote too, there is no quote in /etc/hosts/ and there is no white space too. I notice this affects mysql and mongodb because i have 127.0.0.1 in the connection string.
Oh, I just rechecked now, the single quote is closing an opening one, it is from mysql, the full response is below: ' (-2)2005 (HY000): Unknown server host '127.0.0.1
It's almost like the IP is treated as a fqdn. Or you managed to loose your "lo" (loopback) networkinterface. What is the output of Code: ip addr
Here it is: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:50:56:55:ef:24 brd ff:ff:ff:ff:ff:ff altname enp0s18 altname ens18 inet x.x.x.x/24 brd x.x.x.255 scope global eth0 valid_lft forever preferred_lft forever
So the "lo" interface is in place. You're sure there is not a typo somewhere by accident? In /etc/hosts for example? And what do you get when you simply ping to 127.0.0.1 from the console or a ssh session?
No typo and I have checked and checked and also reinstalled the server. I get a response back when i ping 127.0.0.1
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. c 5.5.5-10.11.6-MariaDB-0+deb12u1=(QB3x'RK��-^yfq&eN7g~hnmysql_native_passwordConnection closed by foreign host.
Ok, just a plain connection is possible. So there's nothing wrong with your loopback interface and MariaDB is listening on it's IP. No clue on why you encounter the problems you are having using 127.0.0.1 and not localhost. Difference between the two is that localhost connects to MariaDB's unix socket and 127.0.0.1 is a tcp connection.
Thanks for all your help on this. It turned out that I have a environment variable that is also a reserved phrase and this confused the server. All is well now. Many thanks.