Restore root login via 'sudo mariadb' command

Well, I needed to switch from password-based authentication to unix-socket authentication.

I ran this command to change the authentication method for my root user.

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

References:

  • https://mariadb.com/kb/en/authentication-from-mariadb-104/