mysql8 创建新用户,并限制访问指定数据库

1.创建用户

create user 'test'@'%' identified with mysql_native_password by '123456';

2.指定限制访问的库
grant all privileges on dbname.* to 'test'@'%' with grant option;

3.刷新权限
flush privileges;

posted @ 2022-08-19 09:35  jiafeng  阅读(272)  评论(0编辑  收藏  举报