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.
Pages: 1 2
Hey guys, I'm on a Ubuntu 16.04 LTS VPS, I installed LAMP and the php-xml extension.. forum is working fine until I try to install ANY plugin and I keep getting this error message :

MyBB has experienced an internal SQL error and cannot continue.
SQL Error:1366 - Incorrect integer value: '' for column 'sid' at row 1Query:INSERT INTO mybb_settings (sid,name,title,description,optionscode,value,disporder,gid) VALUES ('','viewgroups_groups','Hidden User Groups','Enter the group id\'s (seperated by a comma) of the groups that you don\'t want to be displayed on the index page. (leave blank to disable this feature)','text','1,5,7',1,31)


I did some researches and I found something about sql restrict mode, whatever it is I cannot find it and I'm currently stuck. Need your help please!



edit: I don't use phpMyAdmin
The setting for strict mode will be in your my.cnf file, alternatively you can edit the plugin and remove the code where it is trying to set the sid column to an empty string.
(2016-07-08, 11:38 AM)Matt. Wrote: [ -> ]The setting for strict mode will be in your my.cnf file, alternatively you can edit the plugin and remove the code where it is trying to set the sid column to an empty string.

Ok I opened my.cnf file that I found at /etc/mysql/ 
There is no sql-mode or sql_mode to edit or comment out.

And can you please add more details to your 2nd method ? I have no SQL knowledge atm
Can you link me to where you downloaded the plugin?
(2016-07-08, 12:03 PM)Matt. Wrote: [ -> ]Can you link me to where you downloaded the plugin?

http://community.mybb.com/mods.php?action=view&pid=10

Got the same error trying another plugin with "cid" instead of "tid" something like that

(2016-07-08, 12:03 PM)Matt. Wrote: [ -> ]Can you link me to where you downloaded the plugin?

Sorry for the repost but I found something by logging in through mysql in console and checking sql_mode variable, this is what I found:

| sql_mode      | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |

Change it ? to what please?
Okay, in ./inc/plugins/viewgroups.php, line 76, 89 and 102, remove this:

"sid"			=> NULL,

It will be a similar change for other files with the issue.
(2016-07-08, 12:35 PM)Matt. Wrote: [ -> ]Okay, in ./inc/plugins/viewgroups.php, line 76, 89 and 102, remove this:

"sid"			=> NULL,

It will be a similar change for other files with the issue.


Thanks for the quick answer, but this is more of patch than a solution.

Can you tellme how to edit and to what edit the sql_mode variable if it's going to solve the problem ?
It's currently: | sql_mode      | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
I think if you edit this to just be completely empty, and restart MySQL, it will no longer be in strict mode.

However, the issue isn't your server, it is actually the code. This plugin, like others that have this issue, are not coded properly and shouldn't have these lines in, personally I think changing a valid server config to be able to use badly written code is the wrong way of resolving it.
Finally! Thanks for the quick support Matt. Setting up a mybb on an unmanaged linux VPS is like hell, I think you guys should set a documentation just for that, since mybb require some packages that don't come with a default lamp installation. Add to this sql issue.

Thanks again! Issue solved by editting strict mode global variable.
No worries! What other issues did you come across? I installed MyBB on my unmanaged cloud server and it ran okay (not sure what mode MySQL is running in though).
Pages: 1 2