Pierre
Pierre

Reputation: 5156

Export table data without Primary Key

I want to export data from a sql table, but I dont want the primary key to be exported.

The reason is that I have data on my localhost that needs to be inserted in a remote database (remote and local db have the same structure). But on the remote db, the table already has data, and they will be primary key conflicts if I try to add the data from my localhost.

This question has somehow been treated here before: table-without-dumping-the-primary-key.

I used this method in the past, but it's annoying to have to create a new table to make the transfer...

It surprises me that I can't export data from a table while omitting a column, in this case, the primary key column. Been looking the mysql documentation but it wasn't helpful...

Any idea?

Upvotes: 3

Views: 5352

Answers (1)

UltraCommit
UltraCommit

Reputation: 2286

Can you create a VIEW without the primary key, and then export VIEW DATA?

Upvotes: 1

Related Questions