- 创建账号
create user 'username'@'%' identified by 'password';
flush privileges;
- 账号授权
database_name
数据库所有权限
grant all privileges on `database_name`.* to 'username'@'%' identified by 'password';
flush privileges;
- 只读权限
grant select on database1.* to 'username'@'%' identified by 'password';
grant select on database2.* to 'username'@'%' identified by 'password';
flush privileges;
-- select 查询权限,all privileges 所有权限或指定select,delete,update,create,drop权限
-- database1 数据库
-- username 用户账号
-- password 密码
-- % 所有电脑可访问