I'm a web developer so exporting remote databases and importing them locally is quite a common task for me.
After importing, I am getting the following error when trying to create a new post in WordPress:
WordPress database error: [Duplicate entry '0' for key 'PRIMARY']
INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (2, '2023-07-13 17:22:07', '0000-00-00 00:00:00', '', '', 'Auto Draft', '', 'auto-draft', 'post', '', '', '', '', '', '', '2023-07-13 17:22:07', '0000-00-00 00:00:00', 0, 0, '', '')
Here's my setup:
Server MySQL and Docker MySQL are both 5.7
Exporting using Homebrew: /usr/local/Cellarfirstname.lastname@example.org/5.7.42/bin/mysqldump
Only selecting 'Add drop table' or I think it will merge the two datasets. I've tried 'Disable keys' but that doesn't help
Restoring with /usr/local/Cellaremail@example.com/5.7.42/bin/mysql
I was using TablePlus before DataGrip and that worked fine.