I’m experiencing an issue with inserting a SHA1 hash into my MySQL database. The hash is 40 characters long, yet I’m getting an error stating that the data exceeds the column limit.
Here’s what I’ve done so far:
- Started with varchar(20) which was definitely too small.
- Updated it to varchar(40) that should accommodate the SHA1 hash size.
- Attempted changing to TEXT and LONGTEXT types, but the error persists.
My stored procedure command is:
CALL CreateAccount('user123', 'A94F2B8E7D1C9F3E5B6A8D2C4E7F9B1A3C5D8E0F', 'user123', 'user123', @result);
The procedure works fine with shorter strings. I’ve heard that switching MySQL to non-strict mode might resolve this, but I’d rather find a proper solution. What could be behind this problem?