1,创建用户
create user test identified by '123456';
2,分配权限
分配所有权限
grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option;
分配某个数据库所有权限
grant all privileges on test.* to 'test'@'%'identified by '123456' with grant option;
分配某个数据表所有权限
grant all privileges on test.user to 'test'@'%'identified by '123456' with grant option;
分配某个表部分权限
grant select,insert,update,delete,create,drop on test.* to 'test'@'%'identified by '123456' with grant option;
3,刷新权限
flush privileges;