MyBB Hacks

Full Version: Database error - 1364 - Field 'rules' doesn't have a default value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have moved server on a new installation, before I had PHP 5.6 + MySQL 5.1 (I think).

On new server I have now PHP 7.0 + MySQL 5.7.19 (PHP MySQLi) + Ubuntu 16.04 but when I send a new thread or reply on forum I have SQL Error Frown Like:

Code:
MyBB has experienced an internal SQL error and cannot continue.

[b]SQL Error:[/b]
1364 - Field 'rules' doesn't have a default value

[b]Query:[/b]
REPLACE INTO mybb_threadfields_data(`portalimg`,`scadenza`,`mostraonascondi`,`link`,`tid`) VALUES(0,'','','',20213)


portalimg, scadenza, mostraonascondi, link are all Custom Thread Fields.

Table structure in MySQL:

[Image: L0Vmytk.png]

I think my database is messed up Frown

It wants default value, so I flag "default" and add 0 to rules, go to save but "BLOB, TEXT, GEOMETRY or JSON column 'rules' can't have a default value"  but whyyyy, do you want or not this default value!?

[Image: gBSOunj.png]

Do you see 'rules' in your list of thread fields?
If a query isn't supply it, you could try and see if you can set MySQL to run in a less strict mode (see sql_mode setting).
Reference URL's