欢迎来到MySQL实战第84篇,修炼MySQL,让我们更加的自信!
【查看数据库】
【使用mysql数据库】
【创建新用户:mytest,密码111222】
create user mytest identified by '111222';
【查看用户mytest的权限】
select * from user where user='mytest' G
show grants for mytest;
【给用户mytest在数据库moor上附execute(存储过程),insert(插入),update(更新)权限,@'%'表示从任意ip都可以访问这个数据库】
grant execute,insert,update on moor.* to 'mytest'@'%';
【权限生效】
flush privileges;
【再次查询mytest权限】
select * from user where user='mytest' G
show grants for mytest;
【用mytest用户,密码:111222登录】
【检查用户mytest在moor数据库可有select权限?】
求关注,欢迎大家一起修炼!这是MySQL8.0关于创建用户,登录用户,用户权限实际操!