How to enable cross-database federation in mysql?

I am trying to transfer some data from my production database to my sandbox using a query like this:

INSERT `dbsandbox`.`SomeTable`(Field1, Field2, Field3)
SELECT t.Field1, t.Field2, t.Field3
FROM `dbprod`.`SomeTable` t;

When I try to make this cross-base connection, I get the following error:

ERROR 1142 (42000): SELECT statement denied for user 'myusername'@'server.domain.tdl' for table 'SomeTable'

This user has permission to use tables for both databases. I tried this in both the mysql unix client and the MySQL Query Browser application with the same result.

What am I missing?

+5
source share
2 answers

, . , . , .

, MySQL - , . , , . , .

, , , . :

dbprod

INSERT dbsandbox. SomeTable (1, 2, 3) SELECT t.Field1, t.Field2, t.Field3 FROM SomeTable t;

+8

. , .

, .

SELECT t.Field1, t.Field2, t.Field3
FROM `dbprod`.`SomeTable` t;

? , db.

/ ?

+4

All Articles