MySQL: Sync only missing tables

I'm trying to sync two MySQL databases. Not by means of replication, that's already setup in a different environment.

Basically, the two envinronments we have are a QA environment and a production environment. We are looking to deploy a new product and our QA team have missed some steps in documenting the database inserts.

The problem I have is I have a production environment that has a replicating (active/passive) setup. It is missing several tables that QA has and they don't know which are missing and are recieving tons of databases errors related to missing tables.

Is there a way to export the database (I'm using -d so that only the structure comes over, no data) and only have MySQL insert the missing tables?

If not, my solution would be to just wipe our our production instance and refresh it with our QA instance with no data.

Answers


If you add --skip-add-drop-table (or --skip-opt), there won't be any drop statements for your tables. If you run the dump on your other database, the create statements for existing tables will fail, but shouldn't affect anything.

I can't see any option for mysqldump to add "if not exists" for create tables, but I'm not sure you really need it.


Need Your Help

ajax rendered form will not submit

ruby-on-rails ajax jquery ruby-on-rails-4 ajaxform

I have a form that is rendered via ajax when someone clicks on a show form button. The form renders correctly, but it does not submit. When I press submit, nothing happens and the server does not

PagedDataSource for Repeater with RadioButtonList

c# asp.net pagination repeater radiobuttonlist

I am trying to create an Exam with multiple pages of questions. The questions are created dynamically in an SQL proc. I have a Repeater in my aspx page with a RadioButtonList I create dynamically i...