Question

The natural instinct would be to copy/paste the entire row as one would do in MS Excel or other spreadsheet app.

But:

  1. Unique primary key / UNIQUE INDEX fields cannot be duplicated.
  2. If one of the fields has line breaks in it (e.g. a chunk of HTML code) it attempts to create multiple new records instead.

The first issue can be relatively quickly worked around by temporarily turning the indexes off. However, #2 is a pain in the neck. Any ideas anyone?

Of course I could use a query. But the question is about Navicat’s GUI.

Also in case it matters, I use Navicat for MySQL v9.0.8 Enterprise.

Was it helpful?

Solution

I'm using Navicat 11, have a feeling this might not have been so easy (or even possible) in some earlier versions. To do this in Navicat 11, access the table you want to duplicate a record in, so that you can see the rows of data. Right-click the small shaded rectangle at the head of the row you want to copy, left-click 'Copy' in the pop-up menu. Click the '+' that you see at the bottom of the window. Right-click in the left-most field of the new, empty row and left-click 'Paste'. If your new record breaks a Unique key rule, as it usually will, simply amend the newly-created record e.g. by clicking in the field for the auto-incrementing key and editing it to have the next available value.

Edit: this is apparently possible in Navicat version 7 and later

OTHER TIPS

Frankly I prefer Heidisql over Navicat in Heidisql you can duplicate many rows just with insert key but in Navicate there is no simple way to do it https://stackoverflow.com/a/18828794/3562771

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top