collect tables from one mysql database and insert into another

0

Hello! I have a question, is there a way to get information from one mysql database and insert into another one with tables having names?

example: I want all the inserts of the bank 1 table name and insert into the bank 2 table username.

how?

    
asked by anonymous 22.02.2018 / 21:02

1 answer

1

Of course! From the target bank (bank2), you can do this:

INSERT INTO username (coluna1, coluna2)
SELECT coluna1, coluna2
FROM banco1.nome
    
22.02.2018 / 21:14