“Mysql8”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(导入1个版本)
第3行: 第3行:
  
 
ERROR 1410 (42000): You are not allowed to create a user with GRANT
 
ERROR 1410 (42000): You are not allowed to create a user with GRANT
 +
=mysql8 caching_sha2_password trouble =
 +
== trouble Authentication plugin 'caching_sha2_password'==
 +
<pre>
 +
php artisan command:init-all-permission#初始化导致问题
  
 +
Authentication plugin 'caching_sha2_password' cannot be loaded
  
 +
  PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] 
 +
</pre>
 +
 +
==shooting==
 +
<pre>
 +
建用户  这个试过可以的 mysql8 新用户和授权
 +
 +
create user 'live'@'%' identified by 'effsdf7';
 +
#把mysql8 默认安全比较高的 caching_sha2_password改为 mysql_native_password,其实不是一个好的做法
 +
ALTER USER 'live'@'%' IDENTIFIED WITH mysql_native_password BY 'effsdf7';
 +
 +
grant select,insert,update,delete on *.* to 'live'@'%';
 +
 +
flush privileges;刷新权限
 +
 +
授权  good  比较细的权限分授权
 +
 +
如:grant select,insert,update,delete on *.* to 'liveapp'@'%';
 +
 +
grant select,insert,update,delete on `live-`.* to 'lcphp'@'172.16.1.7';
 +
 +
 +
原因
 +
 +
MySQL8.0新特性——默认使用caching_sha2_password作为身份验证插件
 +
 +
 +
| %        | cfbapp    | caching_sha2_password |  新的比较安全的
 +
| %        | liveapp  | mysql_native_password    老的 改成这个为了php73
 +
 +
</pre>
  
 
=trouble=
 
=trouble=

2021年12月7日 (二) 08:32的版本


ERROR 1410 (42000): You are not allowed to create a user with GRANT

mysql8 caching_sha2_password trouble

trouble Authentication plugin 'caching_sha2_password'

php artisan command:init-all-permission#初始化导致问题

Authentication plugin 'caching_sha2_password' cannot be loaded

  PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]  

shooting

建用户  这个试过可以的 mysql8 新用户和授权

create user 'live'@'%' identified by 'effsdf7';
#把mysql8 默认安全比较高的 caching_sha2_password改为 mysql_native_password,其实不是一个好的做法
ALTER USER 'live'@'%' IDENTIFIED WITH mysql_native_password BY 'effsdf7';

grant select,insert,update,delete on *.* to 'live'@'%';

flush privileges;刷新权限

授权  good  比较细的权限分授权 

如:grant select,insert,update,delete on *.* to 'liveapp'@'%';

grant select,insert,update,delete on `live-`.* to 'lcphp'@'172.16.1.7';


原因

 MySQL8.0新特性——默认使用caching_sha2_password作为身份验证插件 


| %         | cfbapp    | caching_sha2_password |  新的比较安全的
| %         | liveapp   | mysql_native_password    老的 改成这个为了php73

trouble

JDBC连接MySQL报错Unknown system variable 'query_cache_size'


MySQL 8.0报错:error 2059: Authentication plugin 'caching_sha2_password' cannot be loaded


ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded; 的解决办法

mysql80远程登录问题--caching_sha2_password

see also

mysql8使用grant授权修改

mysql8.0创建用户授予权限报错解决方法