Environment: The WordPress site is on my local laptop, 4.9.6. Windows 10, XAMPP installation, PHP 7.
The procedure works fine on the remote production server with LAMP.
Problem: I'm trying to upload a new logo to the media library. The file seems to start to upload, but then I get the error message with the red vertical stripe on the left side,
revised logo.png
Could not insert post into the database
When I look in the uploads folder, the new month folder ("5" for May) hasn't been created, so the file wasn't uploaded, either.
Not sure where I need to start on this. The error message says database, but since the file was never uploaded, it seems like a file problem.
It Now Works:
I don't know why the WP Migrate tool exports SQL that doesn't set the ID columns of my WP tables to auto increment. In my case, setting wp_posts and wp_postmeta ID fields to auto increment, using PhpMyAdmin, was the last procedure I did that resulted in the media library being able to insert new images.
Environment: The WordPress site is on my local laptop, 4.9.6. Windows 10, XAMPP installation, PHP 7.
The procedure works fine on the remote production server with LAMP.
Problem: I'm trying to upload a new logo to the media library. The file seems to start to upload, but then I get the error message with the red vertical stripe on the left side,
revised logo.png
Could not insert post into the database
When I look in the uploads folder, the new month folder ("5" for May) hasn't been created, so the file wasn't uploaded, either.
Not sure where I need to start on this. The error message says database, but since the file was never uploaded, it seems like a file problem.
It Now Works:
I don't know why the WP Migrate tool exports SQL that doesn't set the ID columns of my WP tables to auto increment. In my case, setting wp_posts and wp_postmeta ID fields to auto increment, using PhpMyAdmin, was the last procedure I did that resulted in the media library being able to insert new images.
Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked May 20, 2018 at 15:46 Galloway GrumblefieldGalloway Grumblefield 351 silver badge8 bronze badges1 Answer
Reset to default 1setting wp_posts ID field and wp_postmeta meta ID field to auto increment, using PhpMyAdmin. SOLVED MY PROBLEM