创建过程如下:
- 创建用户
create user 用户;
- 授权
GRANT ALL PRIVILEGES ON *.* TO 用户@”%” IDENTIFIED BY ‘密码’ WITH GRANT OPTION;
其中 *.* 指 dbname.tablename,若*.* 则表示对所有库和表授权
- 生效
flush privileges;
create user admin;
GRANT ALL PRIVILEGES ON *.* TO admin@"%" IDENTIFIED BY 'admin' WITH GRANT OPTION;
flush privileges;