strict mode in mysql
SHOW VARIABLES LIKE 'sql_mode'; -- enabled if STRICT_TRANS_TABLES is present
SET GLOBAL sql_mode=''; -- disables strict mode
SET GLOBAL sql_mode='STRICT_TRANS_TABLES'; -- enables strict mode
strict mode in mysql
SHOW VARIABLES LIKE 'sql_mode'; -- enabled if STRICT_TRANS_TABLES is present
SET GLOBAL sql_mode=''; -- disables strict mode
SET GLOBAL sql_mode='STRICT_TRANS_TABLES'; -- enables strict mode
how to disable strict mode in mysql
->STRICT_TRANS_TABLES is responsible for setting MySQL strict mode.
->To check whether strict mode is enabled or not run the below sql:
SHOW VARIABLES LIKE 'sql_mode';
If one of the value is STRICT_TRANS_TABLES, then strict mode is enabled, else not. In my case it gave
+--------------+------------------------------------------+
|Variable_name |Value |
+--------------+------------------------------------------+
|sql_mode |STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION|
+--------------+------------------------------------------+
Hence strict mode is enabled in my case as one of the value is STRICT_TRANS_TABLES.
->To disable strict mode run the below sql:
set global sql_mode='';
[or any mode except STRICT_TRANS_TABLES. Ex: set global sql_mode='NO_ENGINE_SUBSTITUTION';]
->To again enable strict mode run the below sql:
set global sql_mode='STRICT_TRANS_TABLES';
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us