Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何在RDS副本实例中创建临时表_Mysql_Amazon Web Services_Amazon Rds_Database Replication - Fatal编程技术网

Mysql 如何在RDS副本实例中创建临时表

Mysql 如何在RDS副本实例中创建临时表,mysql,amazon-web-services,amazon-rds,database-replication,Mysql,Amazon Web Services,Amazon Rds,Database Replication,我的开发人员要求我能够创建 但他们配置的连接已连接到 如何设置权限,使其连接可以在该实例中创建临时表?打开与具有'ALL'权限的用户的连接,连接到您的主RDS实例,并创建tmp数据库作为临时表的存储点: create database if not exists tmp; create temporary table tmp.my_temporary_table select mt.id from my_databaes.my_table as mt limit 10;

我的开发人员要求我能够创建

但他们配置的连接已连接到


如何设置权限,使其连接可以在该实例中创建临时表?

打开与具有'ALL'权限的用户的连接,连接到您的主RDS实例,并创建
tmp
数据库作为临时表的存储点:

create database if not exists tmp;
create temporary table tmp.my_temporary_table
  select 
    mt.id
  from my_databaes.my_table as mt
  limit 10;

select * from tmp.my_temporary_table;

drop temporary table tmp.my_temporary_table;
选择
创建临时表
分配给副本用户的连接:

grant SELECT, CREATE TEMPORARY TABLES ON tmp.* TO youruser@'%';
现在,通过复制副本连接,您可以操作临时表:

create database if not exists tmp;
create temporary table tmp.my_temporary_table
  select 
    mt.id
  from my_databaes.my_table as mt
  limit 10;

select * from tmp.my_temporary_table;

drop temporary table tmp.my_temporary_table;

“写入连接”是什么意思?如何打开?@Andremoniy打开与具有“全部”权限的用户的连接。。或者至少有足够的权限来创建数据库和修改数据库上的权限。这通常是您的
根用户。(为了避免歧义,答案中的措辞发生了变化)啊,好的,它是
mysql
。。。不适合Postgressem创建临时表但不更新它们。因此,它的用途有限。