I am new to MySQL. I would like to copy the content of one table to another table within the same database. Basically, I would like to insert to a table from another table.
If table1 is large and you don't want to lock it for the duration of the copy process, you can do a dump-and-load instead:
CREATE TABLE table2 LIKE table1; SELECT * INTO OUTFILE '/tmp/table1.txt' FROM table1; LOAD DATA INFILE '/tmp/table1.txt' INTO TABLE table2;