how to restore sql file?

edotan asked:

I have 2 MySQL servers. Server A is up to date.
I run the following on Server A:

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

on Server B I run:

mysql -u root -p[root_password] [database_name] < dumpfilename.sql

after I run the mysql import command on Server B – I still see old entries on that server.
what am I missing? I want both servers to have an Identical DB. (after I export and import the file from Server A to Server B).

My answer:

Add --add-drop-table to your mysqldump command. This will cause the tables on the destination to be recreated from scratch with whatever data is in your dump.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.