开发者社区> 问答> 正文

MySQL 有创建临时表的权限,为什么不能插入临时表?

问题描述:
我给用户 helper 添加了权限:
grant create temporary tables on cms.* to 'helper'@'%';
然后创建临时表是成功的:
create temporary table temp_stock(in_no varchar(30));
但是insert 时提示无权限
`insert into temp_stock(in_no) value('tt');
MySql.Data.MySqlClient.MySqlException:
INSERT command denied to user 'helper'@'Lesus-000' for table 'temp_stock'`
grant又不能给临时表insert 权限的.
`create temporary table temp_stock as
select .... ` 这种方式也不行。
该如何解决这个问题啊.

展开
收起
落地花开啦 2016-02-25 16:14:03 4608 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    grant insert on cms.* to helper@'%' identified by '123456';
    如果helper是要严格控制权限的合作或临时用户,那就应该独立一个库比较合适。
    select on cms.* + all on newdb.*

    2019-07-17 18:47:37
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像