Why we Disable MySQL Strict Mode:
Strict mode controls the invalid and missing values in data changing queries on the database. It includes DML (INSERT, UPDATE, DELETE) and DDL (ALTER, CREATE) statements both.
By Default, strict mode is enabled and it provides a warning when invalid or missing data is attempting to process the query.
When strict mode is disabled the same query will provide a simple warning but maybe it will output unexpected results.
We disable Strict mode in MySQL for version compatibility. Because when we import higher version SQL script in lower version MySQL it will give a warning and sometimes it will give an error, in such conditions we have to disable Strict Mode.
Note: Always make a backup before import and export.
Steps to Disable MySQL Strict Mode in Windows:
- Open Mysql Root Directory:
2. Open “my-default.ini” configuration file (Open customized configuration file if you are using your own customized configuration file).
3. Search Keyword “sql_mode” in the configuration file. It has some predefined values like ”
4. Remove the values of “sql_mode” and make it sql_mode=’ ‘ for disabling the strict mode as given in below image.
5. Restart the MySQL Server Manually.
6. Restrict Mode is disabled now, You can enable it by following same steps.