mysql8 新增用户

#切换数据库
use mysql;
#查询用户
select host,user,plugin from mysql.user;
#创建新用户、密码
create user 'Test'@'%' identified with mysql_native_password by 'Test@123456';

#授权
grant all privileges on 数据库名称.* to Test;

#查看用户权限
show grants for Test;

原文地址:https://www.cnblogs.com/xubao/p/14785687.html