mysql权限设置
1、熟悉权限,mysql中存在4个控制权限的表,分别为user表,db表,tables_priv表,columns_priv表。


3、新建一个用户并给予相应数据库的权限。CREATE USER username IDENTIFIED B鳔柩寞泷Y 'password';新用户创建完成,但是此刻如果以此用户登陆的话,会报错,因为我们还没有为这个用户分配相应权限。分配权限的命令如下:grant all privileges on database.* to 'username'@'localhost' identified by 'passwd';上面是授予username用户在database数据库上的所有权限。对应不同的用户还可以设置相应的增删改差权限;grant select,insert,update,delete,create,drop privileges on database.* to 'username'@'localhost' identified by 'passwd';登陆后可以查看权限:show grants;
