Get the App
SLTechnology News&Howtos  ›  Database  › 

How to explain the meaning of sql_mode in MySQL 5.7

Shulou Source: shulou.com Published: 2022-05-31 14:06:39 10月28日 Update

This article introduces how to explain the meaning of sql_mode in MySQL 5.7. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Sql_mode is more stringent in MySQL version 5.7. Explain the meaning of each mode:

ONLY_FULL_GROUP_BY do not let queries in the GROUP BY section point to unselected columns

STRICT_TRANS_TABLES enables strict mode for the transactional storage engine and may also enable strict mode for the non-transactional storage engine

NO_ZERO_IN_DATE is in strict mode and does not accept dates where the month or day is partially zero.

NO_ZERO_DATE is in strict mode and does not use '0000-00' as a legal date

ERROR_FOR_DIVISION_BY_ZERO in strict mode, in the INSERT or UPDATE process, if divided by zero (or MOD (XP0)), an error is generated

NO_AUTO_CREATE_USER prevents GRANT from automatically creating new users unless a password is also specified

NO_ENGINE_SUBSTITUTION prevents automatic replacement of the storage engine if the required storage engine is disabled or uncompiled

Note: in a master-slave environment, in order to ensure the consistency of data, you must set the same master-slave sql_mode and ensure the consistency of sql_mode during data migration, otherwise replication and migration will fail due to the above restrictions, so use standard SQL syntax as much as possible.

On how to explain the meaning of sql_mode in MySQL 5.7 is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Pattern engine storage meaning interpretation consistency master-slave transaction content data date more guarantee help good legal consistency interest password buddy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Redmi Microsoft Shulou Information Shulou Technology