0. 创建数据库mydb
create database mydb;
1. 创建一个用户user01
create user user01;
2. 用户授权
grant all on mydb.* to user01@"%" IDENTIFIED BY "123456";
% ,代表任何ip
IDENTIFIED BY "123456" ,代表设置密码为123456
3. 查看授权情况
show grants for user01@"%";
来源:oschina
链接:https://my.oschina.net/u/2351685/blog/521297