1、 Problem background
Log in to the installed MySQL in the Linux environment
2、 The screenshot of error reporting is as follows

3、 Solution
(1) Modify/etc/my.cnf and add skip grant tables in [mysqld] to skip the password verification process, as shown in the following figure

(2) Restart mysql. After restarting, you can enter MySQL
systemctl restart mysql

(3) Modify MySQL user name and password
mysql> use mysql;
mysql> Update user set password = password (“your new password”) where user = “root”
mysql> flush privileges;
mysql> quit
(4) Then remove the configuration just added in/etc/my.cnf and restart the MySQL service
