Score:0

MariaDB - how to stop it complaining about empty values in configuration?

in flag

I'm moving a site to another server. Both are running MariaDB. The old one is:

mysql  Ver 15.1 Distrib 10.5.8-MariaDB

The new one:

mysql  Ver 15.1 Distrib 10.6.11-MariaDB

On the old server in my.cnf, I put:

[mysqld]
...otherlines
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

This allowed me to run the commands I wanted. So I'm trying to do the same on the new server, but it keeps complaining:

Field 'shipping_name' doesn't have a default value 

If I run this command from the script to see what sql_mode its running, I get:

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE;

enter image description here

What am I missing? Has something changed from 10.5.8-MariaDB to 10.6.11-MariaDB around this?

ua flag
Please provide the `CREATE TABLE` for that table.
Andrew Newby avatar
in flag
@RickJames thanks. I looked at the structure, and it didn't have `DEFAULT NULL` set on those fields. So I did that, but really I don't want to have to go through all my DB structures on all the sites I'm going to be pulling over, just to make sure they have that set. Is there no way to just tell it to ignore those errors?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.