The old school way is to use string concatenation:
SELECT CONCAT('INSERT INTO YOUR_TABLE (col1, col2) VALUES(', t.col1,',', t.col2, ')')
FROM YOUR_TABLE t
Copy the output to a script. Keep in mind that you will have to process data types accordingly (IE date and time).
But I have to wonder why you are not just using mysqldump, and get the INSERT statement from the table backup.
source
share