mysql8 Change Password slightly different way
1. Configure no password
/Etc/my.cnf modify the file, add the module in mysqld
skip-grant-tables
2. Restart mysql
3.mysql -uroot -p directly enter into the data
4. Perform update user set authentication_string = '' where user = 'root'; blank password, and then seemingly must first blanking reset, otherwise it will error
5. Exit the database, modify /etc/my.cnf file newly added skip-grant-tables
6. Restart the database
7. Reset password ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'abc123 @ xxx'; // 'abc123 @ xxx' password is too simple form will error
Reference links https://www.cnblogs.com/yaowen/p/9486997.html