1、创建用户
CREATE USER 'onlyReadUser'@'%' IDENTIFIED BY '123456';
2、授权
2.1、指定onlyReadUser用户访问databases数据库中table表
GRANT SELECT ON `databases`.table TO 'onlyReadUser'@'%';
3、刷新权限
flush PRIVILEGES;
CREATE USER 'onlyReadUser'@'%' IDENTIFIED BY '123456';
2.1、指定onlyReadUser用户访问databases数据库中table表
GRANT SELECT ON `databases`.table TO 'onlyReadUser'@'%';
flush PRIVILEGES;