I have two databases in mysql and I want to move data from one table of database1 to one table in database2. These tables have similar schema. I know that I can use this query for inserting data to a table from another.
Insert Into table1 (select * from table2)
I can do this with command line. The problem is that these tables are from diffrenet databases and I know for reading data from one table, I must choose its database with this sql command
use database1;
how can I do that?
You can use:
insert Into db1.table1 (select * from db2.table2)