一般自己用mysql直接登录的root用户,但是有时候给别人使用时只能给该用户的只读权限
1.登录mysql
mysql -u root -p password
2.创建用户
create user 'username'@'%' identified by 'password';
3.赋予权限
grant select on DB_name.* to 'username'@'%'; //只读
一般自己用mysql直接登录的root用户,但是有时候给别人使用时只能给该用户的只读权限
1.登录mysql
mysql -u root -p password
2.创建用户
create user 'username'@'%' identified by 'password';
3.赋予权限
grant select on DB_name.* to 'username'@'%'; //只读