Search code examples
mysqlrootsudo

Can't run mysql commands as root linux user


As linux root user:

root@local:~# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I'm confused. Shouldn't the root user be able to run mysql without additional authentication? How do I fix this?


Solution

  • ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;