What is the problem with this command.
SELECT * INTO database2.table2 FROM database1.table1;
It returns this error:
ERROR 1327 (42000): Undeclared variable: database2
The goal is to transfer data in table1 to database2.
select ... into is for storing values in variables. See the documenation for more details.
What you need is an insert into .. select ..
insert into database2.table2 (select * from database1.table1)
Use:
CREATE TABLE database2.table2 AS select * from database1.table1;
MySQL probably does not support SELECT ... INTO ... FROM syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With