创建子用户:
insert into mysql.user(Host,User,Password) values("%","用户名",password("密码"));
给子用户授权:
GRANT USAGE ON *.* TO '用户名'@'localhost' IDENTIFIED BY '密码' WITH GRANT OPTION;
flush privileges;
授权数据库给新用户:
grant all privileges on 数据库名.* to 用户名@'%' identified by '密码';
flush privileges;