MyBB Community Forums

Full Version: SQL Error 1054 Unknown column p.posthash in where clause
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was upgrading MyBB to 1.8.x and things didn't go well. I reloaded a backup of 1.6.9 and everything is running except the ability to post. I can preview posts but when I try to post I get this error.

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:1054 - Unknown column 'p.posthash' in 'where clause'

QueryConfusedELECT p.pid, p.visible FROM mybb_posts p WHERE p.uid='1' AND p.tid='10187' AND p.subject='RE: Colonial and civil war ERA relics at the beach' AND p.message='test' AND p.posthash='58f8a123f783f474c3d6e2d600c412eb' AND p.visible != '-2'

You can see the error at my website TreasureIllustrated.com if you try to post to a thread it will pop up.
I know very little about mysql but am a quick learner and can follow directions.

I appreciate any help I can get.

Thanks,
H.Charles
It appears you haven't imported a backup of yout database to restore your previous version.
Thanks Stefan.

Is there a way to determine which version the database is running? And is it possible to repair this without uploading an older backup? I do have a backup from Tuesday morning .... Everything went haywire on Tuesday evening.

The MyBB forum is now running 1.6.9 and this is the only error that I'm receiving.

Thanks for your help.

H.
datacache table of MyBB forum database consists of version information.
eg. field => version , value => a:2:{s:7:"version";s:6:"1.6.9";s:12:"version_code";i:1609;}
(2015-09-17, 04:55 PM).m. Wrote: [ -> ]datacache table of MyBB forum database consists of version information.
eg. field => version , value => a:2:{s:7:"version";s:6:"1.6.9";s:12:"version_code";i:1609;}

Yep that's what I have...
a:2:{s:7:"version";s:5:"1.6.9";s:12:"version_code";i:1609;}
except mine says s:5 instead of s:6
Is that an issue?

Sorry I'm so illiterate when it comes to Mysql.
that should not be an issue.
run file verification tool available at tools & maintenance section of admin panel to find missing / changed files.
ignore files reported from install folder & its subfolders. Also ignore reported images.
you have to replace reported files from MyBB source files pack of your forum's version.

(if you are using Google SEO plugin then do not replace ~/inc/functions.php file)
(2015-09-18, 03:00 AM).m. Wrote: [ -> ]that should not be an issue.
run file verification tool available at tools & maintenance section of admin panel to find missing / changed files.
ignore files reported from install folder & its subfolders. Also ignore reported images.
you have to replace reported files from MyBB source files pack of your forum's version.

(if you are using Google SEO plugin then do not replace ~/inc/functions.php file)

File Verification: Found Problems
File                                                                             Status
images/smilies/angry.gif                                      Changed
images/smilies/cool.gif                                         Changed
inc/plugins/akismet.php                                       Missing

It doesn't appear to me that any of these would cause the Sql error.
It looks to me that the issue is in the MyBB posts and MyBB Threads databases .... but I could be wrong. I just don't know since this is my first time doing this.

When I look at MyBB_Posts in the Mysql database I see this message:
More than one INDEX key was created for column tid

MyBB_Threads has a similar message
More than one INDEX key was created for column uid
[img]<a href=[/img][Image: 2015-09-18_0-51-34_zpsdabl3luv.jpg]" />



I'm trying to import a backup of the database from Monday (the day before the issue started) but it's too large so I'm figuring out how to do that.
Am I doing the right thing or on the right track to fixing this?
Try this for a large database: http://www.ozerov.de/bigdump/
Thanks Leefish! I'll give it a try.