Hey Mike,

Mini-necroposting here, but I think I ran (and have been for some time)
into the same issue you described here.

On Mon, 20 Oct 2025 16:26:02 +0100, Mike wrote:
A while ago (probably bookworm), I built a MySQL server and all was
well.  By default, one could log in with mysql -u root and it connect
via a UNIX socket and auth.  This worked well and I had no complaints.

At some point, which may or may not coincide with an upgrade to
Trixie, this stopping working.  Now, when runnig mysql -u root, I'm
greeted with "ERROR 1698 (28000): Access denied for user
'root'@'localhost'"

I traced my issue down to someting askew with the user setup in
MyS^WMariaDB `unix_socket` auth method. I'm not sure how we got there.

However, I found that running the following command (as the
`debian-sys-maint` user defined in `/etc/mysql/debian.cnf`) to update
the auth method would reset my root user to a functional state of being
able to log-in passwordlessly using the Unix socket.

    alter user 'root'@'localhost' identified via unix_socket;

I'd be interested to know if that works for you, or if you found another
way to fix the issue.

Cheers!

--
Olivier Mehani <[email protected]>
PGP fingerprint: 4435 CF6A 7C8D DD9B E2DE  F5F9 F012 A6E2 98C6 6655
Confidentiality cannot be guaranteed on emails sent or received unencrypted.
Please consider the environment before using AI on this email.

Reply via email to