当前位置:网站首页>Problems encountered in installing mysql8 on MAC

Problems encountered in installing mysql8 on MAC

2022-07-06 05:24:00 Receptive2WE

An error is reported when linking the database

The error information is generally as follows

Connection failed.

MySQL said: Authentication plugin ‘caching_sha2_password’ cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 0x0002): tried: ‘/usr/local/mysql/lib/plugin/caching_sha2_password.so’ (no such file), ‘/usr/local/lib/caching_sha2_password.so’ (no such file),
 Insert picture description here

The question is because MySQL8 Enhanced encryption is used . That is, it cannot be loaded when linking the database ‘caching_sha2_password’ This plugin , That is, you cannot authenticate . some MySQL Management tools ( Like the one I used Sequel Pro) Not yet , Need to use MySQL The previous encryption method can only encrypt the account password . There are two ways to solve :

  1. If the database has no data to be retained , And through DMG File installed , It can be solved by reinitializing the database in the system preferences . Steps are as follows :

    1. Open system preferences , find mysql, Click on Initialize Database.
    2. Enter your new password , Remember this password , It is used for login of later linked database .
    3. choice ‘Use legacy password‘.
    4. restart mysql service
  2. If it's through brew The installed or database already has some data that you want to keep , It can also be solved through the command line . The following three lines :

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_password' PASSWORD EXPIRE NEVER; # Modify encryption rules  
    mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password'; # Update the user's password  
    mysql> FLUSH PRIVILEGES;
    

Either of the above two ways can be used sql Manage tool links MySQL8 The database of . But there may be new problems , Like this one down here ...

An exception is thrown when selecting a database or table , Infinite turn Chrysanthemum

 Insert picture description here

After the first problem is solved, use Sequel Pro An exception may be thrown when selecting a database or table , Start turning chrysanthemums endlessly , And display loading database ‘xxx’. This question can only be used Sequel Pro The version is too old to explain , at present Sequel Pro The latest stable version released 1.1.2 Release time is still 2016 year , and MySQL yes 2018 Published in .. Can't , Use test build Version ,https://sequelpro.com/test-builds Here to download , This test build The version is 19 year 6 Released in April .

原网站

版权声明
本文为[Receptive2WE]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202132112128353.html