
MySQL 8.0 有着更好的性能,速度比 5.7 快2倍json 的支持Mysql 5.7
grant all privileges on *.* 'user'@'%' identified by '123456';Mysql 8.0
create user 'user'@'%' identified by '123456';
grant all privileges on *.* to 'user'@'%';Mysql 5.7 默认认证插件 mysql_native_password
Mysql 8.0 默认认证插件 caching_sha2_password
show variables like 'default_authentication_plugin';修改用户认证插件
alter user 'user'@'%' identified with mysql_native_password by '123456';角色授权增删改查
grant insert,delete,update,select on testdb.* to 'role_name';撤销权限
revoke insert on testdb.* from 'role_name';用户授予角色
grant 'role_name' to 'user';启用设置的角色
set role 'role_name';