Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable strict mode on MariaDB

When i run this sql in phpmyadmin

SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; 

it shows

@@SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 

@@GLOBAL.SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 

How to Disable strict mode on MariaDB using phpmydmin?

like image 598
Dr.Mezo Avatar asked Aug 06 '19 17:08

Dr.Mezo


People also ask

What is strict mode in MariaDB?

A mode where at least one of STRICT_TRANS_TABLES or STRICT_ALL_TABLES is enabled is called strict mode. With strict mode set (default from MariaDB 10.2. 4), statements that modify tables (either transactional for STRICT_TRANS_TABLES or all for STRICT_ALL_TABLES ) will fail, and an error will be returned instead.

How do I enable strict mode on MariaDB?

Get and Set sql_mode SELECT @@GLOBAL. sql_mode; Modify the current sql mode: SET sql_mode='STRICT_TRANS_TABLES,ANSI_QUOTES'; This is the final step in setting up the MariaDB strict mode.


1 Answers

Edit via SSH

/etc/my.cnf file

Add

sql_mode=NO_ENGINE_SUBSTITUTION

restart MariaDB

and it will fix the issue

*edit - if You have error while restarting msyql service try to add "[mysqld]" above in my.cnf

like image 72
Dr.Mezo Avatar answered Sep 21 '22 05:09

Dr.Mezo