Cannot connect to Navicat after MySQL 8.0 is installed

Today I have some free time. I cleaned up the databases used for small test projects and accidentally deleted one of the four databases that comes with MySQL. . . .
Four databases that come with MySQL
I was worried about whether it would affect my future development. After Baidu took a look, how could it be restored. I didn’t find the relevant tutorials, so I directly advised to reinstall. Then I installed the latest mysql 8.0 version directly, and found that Navicat could not connect. 1251 error. Through searching for information on Baidu, some operations have been integrated.

  1. Open the database
    net start mysql

  2. Log in to the root user
    mysql -u root root -p
    enter the password and press Enter

  3. Transfer to the " mysql " database
    use mysql
    Insert picture description here

  4. Set the user's password to never expire
    alter user'root'@'localhost' identified by'your root password ' password expire never;
    Insert picture description here

  5. Change the encryption method
    alter user'root'@'localhost' identified with mysql_native_password by'your root password ';
    Insert picture description here

  6. Refresh rights
    flush privileges;
    Insert picture description here

  7. Done, try it now

Guess you like

Origin blog.csdn.net/interestANd/article/details/112679136