Enable strict mode in mysql

How can I enable strict in MySQL?
Let me get data from strictly SQL and handle the same.

My current slq_mode

mysql> SELECT @@sql_mode;
+------------------------+
| @@sql_mode             |
+------------------------+
| NO_ENGINE_SUBSTITUTION |
+------------------------+
+4
source share
2 answers

Follow these steps:

SET GLOBAL sql_mode='STRICT_TRANS_TABLES';
+5
source

Basically, you have two ways to do this using the SQL command or modify the configuration file. If you install it using the SQL command, it will change after the server is restarted.

Doing this in SQL:

SET GLOBAL sql_mode='STRICT_TRANS_TABLES';

Running this configuration file:

[mysqld] sql_mode="STRICT_TRANS_TABLES"

The location of the file depends on your operating system, more on where it can be found here: https://dev.mysql.com/doc/refman/5.7/en/option-files.html

, :

sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"

SQL, .

SQL : https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html

+1

All Articles