MySQL or MariaDB install has default value of sql mode named STRICT_TRANS_TABLES.
The MySQL docs for STRICT_TRANS_TABLES state:
Strict mode controls how MySQL handles input values that are invalid or missing. A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range. A value is missing when a new row to be inserted does not contain a value for a non-
NULL
column that has no explicitDEFAULT
clause in its definition. (For aNULL
column,NULL
is inserted if the value is missing.)
To fix the issue, edit /etc/mysql/mariadb.conf.d/50-server.cnf in Ubuntu 22, add the following line inside [mysqld] group:
sql-mode="NO_ENGINE_SUBSTITUTION"
Save the file and restart MySQL service.