Mysql 创建用户 数据库 并授权

Scroll Down
创建数据库
create database dbname character set utf8mb4 collate utf8mb4_bin;
创建用户
CREATE USER [email protected]'%' IDENTIFIED BY mypassword;
授权
grant all privileges on dbname.* to [email protected]'%' identified by mypassword;
管理员权限授权
grant all privileges on *.* to [email protected]'%' identified by mypassword;
设置其它用户的权限
GRANT privileges ON databasename.tablename TO [email protected]'%' WITH GRANT OPTION;
刷新权限
flush privileges;