tags: rear end SQL bug database
set @@sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
vim /etc/my.cnf
# Modify the content of sql_mode in [MySQLD],
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
Finally, remember to restart
MYSQLThe service enables the configuration,service mysql restart
| value | usefulness |
|---|---|
ONLY_FULL_GROUP_BY |
For Group By aggregate operations, if the column in select, does not appear in group by, then this SQL is illegal because the column is not in the group by clause |
| NO_AUTO_VALUE_ON_ZERO | This value affects the insertion of the growth column. Under the default settings, insert 0 or null represents the next self -growth value. If the user wants to insert 0 and the column is self -increased, then this option is useful. |
| STRICT_TRANS_TABLES | In this mode, if a value cannot be inserted into a transaction table, the current operation is interrupted, and there is no restriction on the non -transaction statement. |
| NO_ZERO_IN_DATE | In strict mode, the date and month are not allowed to be zero |
| NO_ZERO_DATE | When setting this value, the MySQL database does not allow insertion zero dates, and the zero date will throw an error instead of warning. |
| ERROR_FOR_DIVISION_BY_ZERO | In the INSERT or Update process, if the data is divided by zero, an error is generated instead of warning. If this mode is not given, then the data is returned to NULL when the data is removed from zero |
| NO_AUTO_CREATE_USER | Forbidden users of Grant to create a password to be empty |
| NO_ENGINE_SUBSTITUTION | If the required storage engine is disabled or not compiled, then the error is thrown. When this value is not set, use the default storage engine to replace it, and throw an exception |
| PIPES_AS_CONCAT | Will" |
| ANSI_QUOTES | After enabling Ansi_quotes, you cannot use double quotes to reference string, because it is explained as an identifiable symbol |
Today, I brushed the Niuke.com, I got the most points of the person (2) "topic, From the inscription, you can use a temporary table to solve redundant code, the code is as follows SQL_ERROR_INFO:...
After yesterday finished installing the database when performing any statement, there will be wrong of 1055, but the data shows normal, I wonder; wrong reason: Error information includes sql_mode = on...
Article Directory 1. Question details 1. The code that encountered the problem 2. Error message 2. Solution 1. View the current database sql_mode settings 2. Modify sql_mode settings 3. Modify the mys...
1. Problem The following error is reported when executing SQL: 2. Analysis According to the error message, this is because the sql_mode of Mysql does not match. Just remove the "only_full_group_b...
Talk about conclusions first The root cause of this problem is caused by the rigorous SQL. Because there is no strict restrictions before the 5.7 version, there is no error, but after 5.7, the default...
Foreword: SQL_MODE is a system variable (variable) in MySQL, can be composed of multiple MODE, each MODE controls a behaviorThe default modes in MySQL version 5.7 are: ONLY_FULL_GROUP_BY, STRICT_TRANS...
I wrote a query today, only querying the information of the largest classmate in each class, and the number of students in that class. Error message Cause Analysis Query sql configuration If setONLY_F...
An error is as follows The solution is as follows reason: Optimized for Group B after mysql5.7. The release after the default startup improvement launches the only_full_group_by mode, as long as there...
Sql query the sql mode of your own database: The result is as follows ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERONO_ENGINE_SUBSTITUTION Remove ONLY_FULL_GROUP_BY ...
The following error appears in mysql group query This problem occurs because mysql must force the query field to be enhanced in order to enhance the query efficiency. Unless the field with the aggrega...