I have a mysql and the account can access two DB. One of the DB (testdb) only have read only access, and the temp DB (tmpdb) have read write access. Because I need to handle huge amount of data, so I need to create temporary table and don't want to use PHP insert data one by one from testdb to tmpdb. Is it possible PHP can execute a SQL like below which need to access two DB at the same time?
CREATE TEMPORARY TABLE tmpdb.tmp_customers AS (
SELECT *
FROM testdb.customers
WHERE country='Mexico'
);