how to disable strict mode in mysql

Solutions on MaxInterview for how to disable strict mode in mysql by the best coders in the world

showing results for - "how to disable strict mode in mysql"
Chrissy
14 Aug 2018
1->STRICT_TRANS_TABLES is responsible for setting MySQL strict mode.
2
3->To check whether strict mode is enabled or not run the below sql:
4
5SHOW VARIABLES LIKE 'sql_mode';
6If one of the value is STRICT_TRANS_TABLES, then strict mode is enabled, else not. In my case it gave
7
8+--------------+------------------------------------------+ 
9|Variable_name |Value                                     |
10+--------------+------------------------------------------+
11|sql_mode      |STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION|
12+--------------+------------------------------------------+
13Hence strict mode is enabled in my case as one of the value is STRICT_TRANS_TABLES.
14
15->To disable strict mode run the below sql:
16
17set global sql_mode='';
18[or any mode except STRICT_TRANS_TABLES. Ex: set global sql_mode='NO_ENGINE_SUBSTITUTION';]
19
20->To again enable strict mode run the below sql:
21
22set global sql_mode='STRICT_TRANS_TABLES';