• Re: Can't authenticate to MySQL via UNIX socket

    From Olivier Mehani@3:633/10 to All on Friday, February 20, 2026 09:50:01
    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 <shtrom+debian@ssji.net>
    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.

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mike@3:633/10 to All on Friday, February 20, 2026 11:00:01
    On Fri, Feb 20, 2026 at 06:58:42PM +1100, Olivier Mehani wrote:
    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.

    Hi Olivier,
    Thanks for getting back on this.
    It's been a while, so I'm not certain about the exact details. I know
    that in the end, I couldn't really get to the bottom of it and ended up
    deleting and recreating the user.
    I have a vague feeling that I still couldn't get unix_socket to work and
    ended up setting a password.
    Regards,
    Mike.


    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)