mysql5 - As 'root' can't create database or do anything (Access denied)
FIXED -- mysql created my 'root' account with no privileges (I'm a mysql newb).
I solved by starting mysql with
--skip-grant-tables
Then launching with:
mysql5
And running:
mysql> UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> GRANT ALL ON *.* TO 'root'@'localhost';
Hope this helps someone!
I know this is an old question, but I ran into this issue on a new Macbook running Catalina. The project I'm working on requires me to run an older version of MySQL (5.7), so I installed it via Homebrew and ran into the same issue; unable to do pretty much everything, even as root
user.
Rebooting my machine fixed the problem, and I've waited my whole Stack Overflow career to post this as an answer, so here it is:
Turn it off and turn it back on again