We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

sql strict mode, no default value

Development and Programming

Tilo's avatar
Tilo
81 posts
4 years ago
Tilo's avatar Tilo

After moving my local EE installation to the live server, I got the following error after login into the backend:

SQLSTATE[HY000]: General error: 1364 Field ‘hash_id’ doesn’t have a default value: INSERT INTO exp_security_hashes…

I read that this could be fixed by turning sql strict mode off, but I don’t the have privileges to so with my webhost.

see here: https://stackoverflow.com/questions/43651446/general-error-1364-field-user-id-doesnt-have-a-default-value/43651836 and here: https://stackoverflow.com/questions/37964325/how-to-find-and-disable-mysql-strict-mode

I manually changed the table field to have a default value, which worked temporarily so I could at least access the admin page to change the base_url and base_path. However, I go another error when I browsed to another admin page. Then it complained about a duplicated key in that same table.

Did any come this issue too and fixed it?

       
Tom Jaeger's avatar
Tom Jaeger
228 posts
4 years ago
Tom Jaeger's avatar Tom Jaeger

What version of EE, PHP and MySQL are you currently running?

       
Tilo's avatar
Tilo
81 posts
4 years ago
Tilo's avatar Tilo

php Version: php 7.4.x php-cgi

EE Version: 5.3.2

Mysql: Version information: 4.7.7

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
4 years ago
Robin Sowell's avatar Robin Sowell

hash_id is an auto increment value, it shouldn’t be throwing that. But I recall running into this before…. I think an odd export lost all of the auto_increment settings. Go look at the structure of your exp_hashes table- is hash_id set to auto_increment? I’m betting those got lost-

> Then it complained about a duplicated key in that same table.

Which would explain ending up with duplicate keys.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.