mysql的grant语法
2008-05-16 14:33
155 查看
例1: 增加一个用户test1密码为abc,让他可以在任何主机上登录,并对所有数据库有查询、插入、修改、删除的权限。
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
ON 子句中*.* 说明符的意思是“所有数据库,所有的表”
例2: 增加一个用户test2密码为abc, 让他只可以在localhost上登录,并可以对数据库mydb进行查询、插入、修改、删除的操作。
grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
权限 列 Context
select Select_priv 表
insert Insert_priv 表
update Update_priv 表
delete Delete_priv 表
index Index_priv 表
alter Alter_priv 表
create Create_priv 数据库、表或索引
drop Drop_priv 数据库或表
grant Grant_priv 数据库或表
references References_priv 数据库或表
reload Reload_priv 服务器管理
shutdown Shutdown_priv 服务器管理
process Process_priv 服务器管理
file File_priv 在服务器上的文件存取
PS:有时远程不能访问mysql时,关闭window自带的firewall再试试.
grant select,insert,update,delete on *.* to test1@"%" Identified by "abc";
ON 子句中*.* 说明符的意思是“所有数据库,所有的表”
例2: 增加一个用户test2密码为abc, 让他只可以在localhost上登录,并可以对数据库mydb进行查询、插入、修改、删除的操作。
grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";
权限 列 Context
select Select_priv 表
insert Insert_priv 表
update Update_priv 表
delete Delete_priv 表
index Index_priv 表
alter Alter_priv 表
create Create_priv 数据库、表或索引
drop Drop_priv 数据库或表
grant Grant_priv 数据库或表
references References_priv 数据库或表
reload Reload_priv 服务器管理
shutdown Shutdown_priv 服务器管理
process Process_priv 服务器管理
file File_priv 在服务器上的文件存取
PS:有时远程不能访问mysql时,关闭window自带的firewall再试试.
相关文章推荐
- MySQL grant 语法的详细解析
- MySQL:Grant 语法详解(MySQL 5.X)
- MySQL grant 语法的详细解析
- MySQL 用户权限分配 Grant 语法详解(转)
- MySQL:Grant 语法详解(MySQL 5.X)
- MySQL 用户权限分配 Grant 语法详解
- MySQL grant 语法的详细解析
- MySQL grant 语法的详细解析
- 连接mysql提示ERROR 1045 (28000),,grant语法
- MySQL grant 语法的详细解析
- MySQL grant 语法的详细解析
- MySQL grant 语法的详细解析
- mysql的grant命令
- Mysql学习笔记一——curd基本语法
- mysql 和 mongo db 语法对比
- MYSQL 无重复插入数据更新语法
- MySQL:查询语法精讲(三)
- mysql操作命令梳理(4)-grant授权和revoke回收权限
- 关于MySQL的LIMIT 语法小优化!