Thesqldump insert data to exists table

MySQLmysqldump

hellow

Dumped x.sql file from db and then
trying to find way to insert data from x.sql file to existent tbl in another server.
But mysql execute all the concept of the x.sql ( that include "drop table if exists tbl and create new")

mysql –host= –user= –password= schema tbl < x.sql

there is away may be to dump tbl (with out "drop and create new" commands only insert )?

Best Answer

If you can rebuild the x.sql, run mysqldump with suitable option such as --no-drop-tables, --no-creates (or whatever they are). Then look at the dump file to make sure there are no surprises in it.

If you can't rebuild x.sql, then edit it to get rid of drops/creates/etc.

If there are no USE statements in x.sql, you can say mysql ... new_db < x.sql (after doing CREATE DATABASE new_sql). Then play SQL games to copy the data from new_db.foo to old_db.foo. (Provide more details if you need help in this area.)