0

Hi,

I have two databases (live and staging). Extra columns have been added to various tables within the staging database by another developer while they were extending the websites functionality.

Now has come the time to put the new functionality live, which means taking the staging database schema, creating a new live database and inserting the existing live database data into the new database.

What I want to do is create a mysqldump, which uses the following syntax, so that values are matched to a specified field name, not a field order.

INSERT INTO `table_x` SET `field_a` = 'A', `field_b` = 'B', `field_c` = 'C';

I've tried the --complete-insert and --no-create-table-info, and cannot see any other option that might be relevant. Does anyone have any experience with doing this and can provide some insight?

Thanks for your time.

R.

1
Contributor
1
Reply
4
Views
7 Years
Discussion Span
Last Post by blocblue
1

I think I've just answered my own question actually.

Using the --complete-insert option does give a field to value mapping. So this together with the -no-create-info option seemed to work.

Thanks anyway, and I hope this helps someone.

R.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.