I\'m new to the whole Mac experience. I recently installed MySQL and it seems I have to reset the password after install. It won\'t let me do anything else.
Now I al
If this is NOT your first time setting up the password, try this method:
mysql> UPDATE mysql.user SET Password=PASSWORD('your_new_password')
WHERE User='root';
And if you get the following error, there is a high chance that you have never set your password before:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
To set up your password for the first time:
mysql> SET PASSWORD = PASSWORD('your_new_password');
Query OK, 0 rows affected, 1 warning (0.01 sec)
Reference: https://dev.mysql.com/doc/refman/5.6/en/alter-user.html
If you started mysql using mysql -u root -p
Try ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Source: http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
If you use MySQL 5.7.6 and later:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
If you use MySQL 5.7.5 and earlier:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
MySQL Documentation
remember versions 5.7.23 and up - the user table doesn't has column password instead authentication string so below works while resetting password for a user.
update user set authentication_string=password('root') where user='root';
I have same problem on Mac
First, log in mysql with sandbox mode
mysql -u <user> -p --connect-expired-password
Then, set password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('XXXX');
Query OK, 0 rows affected, 1 warning (0.01 sec)
It works for me ~
via: https://dba.stackexchange.com/questions/118852/your-paswssword-has-expired-after-restart-mysql-when-updated-mysql-5-7-8-rcde
Here is the way works for me.
mysql> show databases ;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> uninstall plugin validate_password;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)