I have been trying to reset my MySQL root password. I have run the mysqld_safe --skip-grant-tables, updated the root password, and checked the user table to make sure it is
On MySQL 8.0.4+
To update current root user:
select current_user();
set password = 'new_password';
To update other user:
set password for 'otherUser'@'localhost' = 'new_password';
To set password policy before updating password:
set global validate_password.policy = 0;
set password = 'new_password';
set password for 'otherUser'@'localhost' = 'new_password';
Other / better way to update root password:
mysql_secure_installation
Want to stick with 5.x authentication so you can still use legacy apps?
On my.cnf
default_authentication_plugin = mysql_native_password
To update root:
set global validate_password.policy = 0;
alter user 'root'@'localhost' identified with mysql_native_password by 'new_password';