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 inx.sql
, you can saymysql ... new_db < x.sql
(after doingCREATE DATABASE new_sql
). Then play SQL games to copy the data fromnew_db.foo
toold_db.foo
. (Provide more details if you need help in this area.)