安装mysql8.0遇到的问题SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
alter user 'root'@localhost IDENTIFIED WITH mysql_native_password BY '120120120';
先上解决方案
MacBook-Pro ~ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 8.0.34 Homebrew
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> alter user 'root'@localhost IDENTIFIED WITH mysql_native_password BY '120120120';
Query OK, 0 rows affected (0.00 sec)
mysql>
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
请先登录后再评论登录