I have set a root password, but cannot authenticate with it. How can I reset this password?
~ mysql --version: mysql Ver 8.0.13 for osx10.14 on x86_64 (Homebrew)
I used these stackoverflow instructions to set a root password and queried the user table to verify the password.
I then tried mysql -u root -p
and mysql -u root
and got authentication errors.
Command: mysql -u root -p
Authentication error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
. I am SURE I am using the correct password.
Command:mysql -u root
Authentication error: Error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
.
That led me to this this stackoverflow question and attempted @Lahiru's solution, but got No such file or directory
.
I found the Mysql documentation and performed the following: (as outlined in B.6.3.2.3 Resetting Root Password: Generic Instructions)
mysql.server start --skip-grant-tables
Mysql -u root
FLUSH PRIVILEGES
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Then I got an error:
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
Lastly, using the Mysql 8.0 documentation: 13.7.1.10 SET PASSWORD Syntax I tried:
mysql.server start --skip-grant-tables
SET PASSWORD FOR 'root'@'localhost' = '1111';
and get error: ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
I can't try to do this while running the server out of safe mode because it doesn't accept the password I set.
Thanks in advance for any help.