# Mysql Maria DB fields don't have defualt value

**URL:** <https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803>\
**Category:** General Discussion\
**Created:** [January 31, 2022, 2:04pm UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803 "2022-01-31T14:04:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![briand](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/b/e9c0ed/32.png) [@briand](https://forum.virtualmin.com/u/briand)\
**Post date:** [January 31, 2022, 2:04pm UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/1 "2022-01-31T14:04:30Z")

</div>

as far as I gather this is the cause: STRICT\_TRANS\_TABLES

sql\_mode = STRICT\_TRANS\_TABLES,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION

i wish to remove STRICT\_TRANS\_TABLES

I’ve searched and the info tells me to modify the my.cnf file (or one of the cponfig files).  
however. I seem unable to find the correct config file or the data in mariadb in control panel. ( I see the above parameter but can;t change it)

MariaDB version 10.3.32  
Operating system Ubuntu Linux 20.04.3  
Webmin version 1.984

thanks for any pointers  
Brian

---

<div class="post-metadata">

**Author:** ![briand](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/b/e9c0ed/32.png) [@briand](https://forum.virtualmin.com/u/briand)\
**Post date:** [January 31, 2022, 4:43pm UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/2 "2022-01-31T16:43:00Z")

</div>

Peter mentioned I should do more checking and set the parameters, hence the reason for the mechanisms.(as I had ported from mysql to maraidb)

indeed, but I’m happy with the way it was ;o)  
I would like to remove STRICT\_TRANS\_TABLES so will check further

I did manage to remove STRICT\_TRANS\_TABLES by getting the right password for the system (typing command in) but not sure its yet saved on a reboot (I tried GLOBAL)

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [February 2, 2022, 11:28am UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/4 "2022-02-02T11:28:17Z")

</div>

Hi,

Have a look at **Webmin / Servers ⇾ MySQL Database Server: Edit Config Files** page and edit **/etc/mysql/mysql.conf.d/mysqld.cnf** file.

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/0/0ddb522a6bf76945563a8b5665fb1913638049c2.png)

As the default for MySQL on Ubuntu 20.04 includes **`STRICT_TRANS_TABLES`** for **`sql_mode`** :

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/8/83229270b68e0c03b48c586c2aaf7c94e3197ea4.png)

… all you should do is to copy defaults and removing wished option, and adding that line of directives to **`mysqld.cnf`** file, under **`[mysqld]`** section and restarting MySQL aftetwards:

```auto
sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

```

This will preserve defaults minus mentioned option you wished to remove, and that will survive restarts/reboots.

---

<div class="post-metadata">

**Author:** ![briand](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/b/e9c0ed/32.png) [@briand](https://forum.virtualmin.com/u/briand)\
**Post date:** [February 2, 2022, 11:40am UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/5 "2022-02-02T11:40:17Z")

</div>

Thanks for your input

I’ll check it shortly

---

<div class="post-metadata">

**Author:** ![briand](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/b/e9c0ed/32.png) [@briand](https://forum.virtualmin.com/u/briand)\
**Post date:** [February 4, 2022, 10:30am UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/6 "2022-02-04T10:30:49Z")

</div>

Hi Ilia,  
thanks for your help on that, it clarified what I needed to do.

I updated this file:  
**/etc/mysql/mariadb.conf.d/50-server.cnf**

wityh this:  
[mariadb-10.3]

sql\_mode = ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION

restarted MariaDB and it has saved the details.

thank you

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 5, 2022, 10:31am UTC](https://forum.virtualmin.com/t/mysql-maria-db-fields-dont-have-defualt-value/113803/7 "2022-04-05T10:31:19Z")

</div>

Closed on April 5, 2022, 10:31am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
