SQLSTATE[HY000] [1698] Access denied for user ‘root’@’localhost’

It turns out you can’t use the root user in 5.7 anymore without becoming a sudo‘er. That means you can’t just run mysql -u root anymore and have to do sudo mysql -u root instead.

That also means that it will no longer work if you’re using the root user in a GUI (or supposedly any non-command line application). To make it work you’ll have to create a new user with the required privileges and use that instead.

See this answer for more details.

Leave a Comment