1, 能否只赋予某个表一定的权限。
比如说,
GRANT SELECT, DELETE, UPDATE, INSERT ON *.* TO usr@'localhost';
但现在只对于mydb.tbl有alter的权限,这能实现吗?2, 如果相对数据库进行truncate table 的操作,改给用户grant什么权限呢?谢谢!
比如说,
GRANT SELECT, DELETE, UPDATE, INSERT ON *.* TO usr@'localhost';
但现在只对于mydb.tbl有alter的权限,这能实现吗?2, 如果相对数据库进行truncate table 的操作,改给用户grant什么权限呢?谢谢!
2 需要drop权限
grant alter on 库.表名 to 'root'@'localhost';2、赋delete权限即可。
照着做了,执行成功,但我怎样查知是否真正生效呢?
如果select * from mysql.user\G的话,alter_priv显示还是N
然后退出重新登陆才有效,对现保留着的连接无效。
show grants for 'login'@'hostname';
TRUNCATE TABLE requires the DROP privilege as of MySQL 5.1.16. (Before 5.1.16, it requires the DELETE privilege
另外如果是用的 grant 而不是直接操作的 grant table 中的记录,则不需要 flush privileges ,下次登录时则生效。http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#privilege-changes
5.7.7. 权限更改何时生效
是啊,我用的是5.1.38,我说为什么没给drop权限truncate就不行呢?