MyBB Community Forums

Full Version: Internal SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Quote:MyBB has experienced an internal SQL error and cannot continue.
SQL Error:1054 - Unknown column 'loginlockoutexpiry' in 'field list'Query:SELECT loginattempts, loginlockoutexpiry FROM mybb_users WHERE uid='1'
Please contact the MyBB Group for technical support.

I'm not sure if it occurs anywhere else on my forum yet, but this has been an issue for a while now for me. I know the cause was very likely to be a mistake I made during an upgrade a while back, where I didn't upgrade incrementally, i.e. 1.8.18 to 1.8.20 (these are not the versions I jumped between, this is just an example).

I figure the fix is to fresh install MyBB, but I've never done such a thing before and so I'm really nervous on what I need to do to make sure that my forum is the same as it is now, minus these errors. I don't know what exactly the backups backup and if there is anything I have to backup separately from that. I'm scared I'm going to miss something and lose it when I kill everything to recreate it.

I tried to fix it myself earlier this week but ended up unexpectedly deleting my board and freaked out. Luckily my host had a backup of my database so I could undo it, but that experience has left me really scared with fixing this now so I just want some help and reassurance so I don't go into this with crippling anxiety. >.<
It looks like MyBB 1.8.16 changes were not applied properly - you can try overwriting files with the MyBB 1.8.20 package and running an upgrade with old version set to 1.8.15.
My board is already running on 1.8.20, so would I just need to do an upgrade with the version set as 1.8.15 or do I need to upload the files again? Also, do you mean the full package or just the upgrade package?
(2019-05-06, 06:30 PM)Moonface Wrote: [ -> ]My board is already running on 1.8.20, so would I just need to do an upgrade with the version set as 1.8.15 or do I need to upload the files again? Also, do you mean the full package or just the upgrade package?

It's possible that some of them were not overwritten when the 1.8.16 update went wrong, or at any other point - the Tools & Maintenance → File Verification tool in the ACP can verify that all files for the current version look OK.

Running the upgrade with version set to 1.8.15 would apply all additional changes (i.e. other than files) from 1.8.16 to 1.8.20, including adding the missing column. Re-running it through these versions should apply the missed ones (in this case, there's are no additional changes later on in 1.8.17 throughout 1.8.20).

Regarding backups, usually backups of the MyBB directory and the database are enough (export with ACP: https://docs.mybb.com/1.8/administration/backups/, import/export with phpMyAdmin: https://help.dreamhost.com/hc/en-us/arti...e-or-table, https://help.dreamhost.com/hc/en-us/arti...e-or-table).
I just performed an upgrade by selecting 1.8.15 as the version I was upgrading from, and it appears to have fixed that error. I assume if there were any other Internal SQL errors I was not aware of that they are fixed too?
(2019-05-06, 07:24 PM)Moonface Wrote: [ -> ]I just performed an upgrade by selecting 1.8.15 as the version I was upgrading from, and it appears to have fixed that error. I assume if there were any other Internal SQL errors I was not aware of that they are fixed too?

Yes, at least those related to changes made in 1.8.16.

If you'd like to inspect further, the DVZ Integrity Tools plugin can additionally list any database structure discrepancies (missing columns usually cause these kinds of errors).