MYSQL权限表user
cmd中进人mysql找到mysql安装目录
E:\wamp\bin\mysql\mysql5.6.12\bin>mysql.exe -u 用户名 -p密码
cmd查看ip
ipconfig
修改密码
1.update user set password=password(1111) where user =
'root'
;
2.
flush
privileges; 刷新权限
新增用户
on*.* 表示 on所有数据库.所有表 授权给谁to user 来自哪
'host'
密码
'password'
;
常用权限 [all(所有),create,drop,insert,
delete
,update,select];
grant [权限1,权限2,权限3] on*.*to user@
'host'
identified by
'password'
;
给l用户全局权限
grant all on*.* to l@
'192.168.0.%'
identified by
'1'
;
给用户s只用有shang数据库的所有权限
grant all on shang.* to s@
'192.168.0.%'
identified by
'1'
;
只给用户某一个表的权限
grant select,update,insert on shang.user to u@
'192.168.0.%'
identified by
'1'
;
删除用户
Delete
from user where user =
"list"
and
host =
"192.168.1.%"
;
收回用户所有权限
revoke all on*.* from l@
'192.168.0.%'
;
查看用户权限
针对全局权限
select * from user;
针对库级别
select * from db'
针对表级别
select * from tables_priv'