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-
NULLcolumn that has no explicit
DEFAULTclause in its definition. (For a
NULLis 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:
Save the file and restart MySQL service.