mysq创建用户并分配权限到某个数据库上

 

mysq创建用户并分配权限到某个数据库上

 

 创建一个mysql用户:

create user 'kent'@'%' identified by 'kentpassword'; 

或者是创建一个mysql本地用户:

create user 'kent'@'localhost' identified by 'kentpassword';  

mysql权限分配给用户:

grant all privileges on kentdb.* to 'kent'@'%' with grant option;  

或者mysql权限分配给本地用户:

grant all privileges on kentdb.* to 'kent'@'localhost' with grant option; 

 

 然后,查看下该用户的权限:

show grants for 'kent';

 

你可能感兴趣的:(mysql,权限)