我的开发人员要求我能够创建 Temporary Tables .
但是他们配置的连接连接到一个RDS Read Replica Instance .
我如何设置权限以便他们的连接可以在该实例中创建临时表?
最佳答案
使用具有'ALL' 权限 的用户连接到您的master RDS 实例,并创建一个tmp
数据库作为存储点临时表:
create database if not exists tmp;
将 SELECT
和 CREATE TEMPORARY TABLES
分配给您的副本用户的连接:
grant SELECT, CREATE TEMPORARY TABLES ON tmp.* TO youruser@'%';
现在,您可以通过副本连接操作临时表:
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;
关于mysql - 如何在 RDS 副本实例中创建临时表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37440177/