mariadb104 or mariadb105 fail to resolve localhost and therefore cannot connect to local db instance, suspect skip_name_resolve is locked to 1 as numeric ip works. Querying localhost with resolveip returns expected result.
Is MariaDB client supposed to connect to localhost instead of file socket? Is MariaDB server listening on localhost is the socket not firewalled? What is localhost address/addresses in your case ?
I see the issue on *-server, regardless of whether the localhost is 127.0.0.1 or 127.0.1.1 or 1127.0.2.1 etc.
(In reply to John R from comment #2)
localhost usually resolves to ::1. Are you sure that IPv6 is supported in your install ?
I don't use ipv6 and I never mentioned it.
Could you please describe it better? How can one reproduce your issue?
If I have a website running that requires backend connection to the db, it fails to connect when the ipaddress is set up as localhost, however when I change it to the numeric ip, it connects. That better? :)
I believe it's not a bug. Please consider closing this PR and checking/editing the contents of /etc/hosts or/and enabling connections and required grants on [::1]:3306 socket.
What exactly should I have in /etc/hosts ?
At the moment it is like this...
#::1 localhost localhost.my.domain
127.0.0.1 hostname.domain.co.uk BuildBSD localhost localhost.domain.co.uk
Host and domain obfuscated.
Also I had grants for user@localhost and email@example.com added too. Made no difference till I changed localhosts to 127.0.0.1 on the website connection details.
Additionally, mariadb provides resolveip which I used to confirm it did see localhost as the expected 127.0.0.1, still failed to connect.
This is expected behavior of MySQL and MariaDB. When the hostname is equal to "localhost", the protocol uses UNIX Sockets rather than TCP Sockets. While the linked document is for MySQL 8.0, this has been the norm throughout the MySQL/MariaDB 5.x days and still in MariaDB 10.x. This is basically a legacy "feature" in MySQL that has never been changed.