密码模式PDO::__construct():服务器请求客户端未知的认证方式[caching_sha2_password]mysql8之后默认密码模式改为caching_sha2_password,新模式需要新的驱动,至少pdo还没有给/导航器。所以我们还是要切换到旧的mysql_native_password模式。`mysql_native_password`:below7.0`caching_sha2_password`:above8.01.my.cnf配置默认密码方式[mysqld]default_authentication_plugin=mysql_native_password2.更新账户的密码方式#新建账户createuser'root'@'%'identifiedwithmysql_native_passwordby'123456';#Existingaccountalteruser'root'@'%'identifiedwithmysql_native_passwordby'123456';3.如果需要授权#Authorizationcannotbemergedtocreateaccounts,onlygrantallprivilegeson*.*to'root'@'%'withgrantoption;flushprivileges;PasswordcomplexitypolicyERROR1819(HY000):Your密码复杂度验证策略导致的密码不满足当前策略要求,关闭后设置可以设置globalvalidate_password.policy=0;设置全局validate_password.length=6;默认编码PDO::__construct():服务器发送的字符集(255)客户端未知。请向开发人员报告设置mysql服务的默认编码#DefaultHomebrewMySQLserverconfig[client]default_character_set=utf8mb4[mysql]default_character_set=utf8mb4[mysqld]default_authentication_plugin=mysql_native_passwordcharacter_set_server=utf8mb4collat??ion_server=utf8mb4_general_ci远程访问1、my.conf添加注释掉本地监控账号1,12_s更新[mysqld.2.0=bind]hostupdatemysql.usersethost='%'whereuser='root';
