Title: Getting SQL Errors when Uploading Files
Last modified: August 18, 2016

---

# Getting SQL Errors when Uploading Files

 *  [Shadal](https://wordpress.org/support/users/shadal/)
 * (@shadal)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/)
 * I just installed WordPress and when I try to upload a file I get the error below.
   The file is being uploaded to the wp-content/uploads directory, it’s just not
   showing in the post.
 * WordPress database error: [Field ‘post_content_filtered’ doesn’t have a default
   value]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content,
   post_title, post_excerpt, post_status, 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 (‘1’, ‘2006-05-23 00:04:11’, ‘2006-05-23 05:04:11’,”,‘
   Area-Focus-Web3.png’, ”, ‘attachment’, ‘open’, ‘open’, ”, ‘area-focus-web3png’,”,”,‘
   2006-05-23 00:04:11’, ‘2006-05-23 05:04:11’, ‘-1148360637’, ‘0’, ‘image/png’,‘
   [http://www.shadal.net/classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.png&#8217](http://www.shadal.net/classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.png&#8217);)
 * WordPress database error: [You have an error in your SQL syntax; check the manual
   that corresponds to your MySQL server version for the right syntax to use near”
   at line 3]
    SELECT category_id FROM wp_post2cat WHERE post_id =
 * WordPress database error: [You have an error in your SQL syntax; check the manual
   that corresponds to your MySQL server version for the right syntax to use near‘
   1)’ at line 2]
    INSERT INTO wp_post2cat (post_id, category_id) VALUES (, 1)
 * WordPress database error: [Out of range value adjusted for column ‘post_id’ at
   row 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES (”,’_wp_attached_file’,’
   E:\Apache\Shadal\classnotes/wp-content/uploads/2006/05/Area-Focus-Web3.png’)
 * WordPress database error: [Out of range value adjusted for column ‘post_id’ at
   row 1]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES (”,’_wp_attachment_metadata’,’
   a:4:{s:5:\”width\”;i:1080;s:6:\”height\”;i:810;s:14:\”hwstring_small\”;s:23:\”
   height=\’96\’ width=\’128\’\”;s:4:\”file\”;s:74:\”E:\\Apache\\Shadal\\classnotes/
   wp-content/uploads/2006/05/Area-Focus-Web3.png\”;}’)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392742)
 * Very odd.
    Check that all the files did in fact upload?
 *  Thread Starter [Shadal](https://wordpress.org/support/users/shadal/)
 * (@shadal)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392758)
 * Well I just re-copied all of the files from the archive to my webroot and it 
   didn’t seem to fix anything.
    The images are getting uploaded and thumbnails 
   are being created, it’s just not adding them into the post for some reason. I
   was able to go in manually and add them but I’m looking for a quick way to throw
   the pics up.
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392762)
 * Who is your host?
    Do you have any plugins installed?
 *  Thread Starter [Shadal](https://wordpress.org/support/users/shadal/)
 * (@shadal)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392779)
 * I’m running my own apache 2.0, php 5, MySQL5.
    No wordpress plugins installed
   The server itself is a pretty fresh windows 2k3 re-install, running about 3 weeks
   now.
 * I thought maybe there were some php errors happening so I turned errors on in
   php.ini but nope, nothing came up…
 *  Thread Starter [Shadal](https://wordpress.org/support/users/shadal/)
 * (@shadal)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392792)
 * Well I’ve tried deleting the SQL database and re-installing a fresh one but still
   get the errors.
 * I went ahead anyway and installed wpStats from [http://binslashbash.org/](http://binslashbash.org/)
   and get an error on the stats page in the ‘bots’ section
 * WordPress database error: [You have an error in your SQL syntax; check the manual
   that corresponds to your MySQL server version for the right syntax to use near‘
   group by clientOS order by oTotal desc’ at line 1]
    SELECT COUNT(cid) as oTotal,
   clientOS FROM wp_stats where group by clientOS order by oTotal desc
 * Looks like it get’s cut off. Maybe it’s because there is no bot data, but I have
   a feeling that whatever is causing the upload problem is causing this. If you
   see the site [http://www.shadal.net/classnotes](http://www.shadal.net/classnotes)
   you’ll see that I’m able to post and do everything else.
    Any other ideas? Thanks
 *  Thread Starter [Shadal](https://wordpress.org/support/users/shadal/)
 * (@shadal)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392839)
 * I’m still getting this, does anyone have any suggestions? Am I missing a module
   wordpress needs in apache or mysql maybe? PHP extension? Any Ideas? …Help…
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392840)
 * Someone correct me if I’m wrong – but I think the issue is that you’re running
   MySQL 5. From what I recall (again, if I’m wrong, please beat me with a wet noodle!)
   WordPress isn’t compatible with MySQL5 yet….so that could be a big issue right
   there.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392841)
 * With 2.0.2 I believe WP _is_ compatible with mysql 5. Earlier versions had “issues”…
 * I’ve seen quite a few comments, however, but image uploading and using WIMP (
   windows/iis/mysql/php). Not sure what to suggest though.
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392842)
 * See? Handy beat me with the wet noodle. 😉 There goes my theory! (Sorry I can’t
   be of more help!)

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Getting SQL Errors when Uploading Files’ is closed to new replies.

## Tags

 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * Last activity: [19 years, 11 months ago](https://wordpress.org/support/topic/getting-sql-errors-when-uploading-files/#post-392842)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
