The symptoms are looking as the following:
Not sure how this happened probably because of some media plugin but this occurs under your WordPress –> Media when you’re trying to upload any new picture
Anyway I have fixed it by altering wp_posts table to make ID as index table and enabled AUTO_INCREMENT as showed below
Detailed steps:
- login your phpMyAdmin - click your database - click wp_posts table (watch your prefix) - click "Structure" tab - click "More" to set Index/Primary - click "Change" to enable A_I (AUTO_INCREMENT) - click "Save"
Should be going well now.
Source: https://wordpress.org/support/topic/cant-upload-to-media-library-3/page/3/
Source: https://stackoverflow.com/questions/5665571/auto-increment-in-phpmyadmin