tags: SpringBoot-MyBatisPlus mysql sql database
I encountered a MySQL version problem when doing paging; the above errors occurred when using the group by paging in the MySQL version 5.7 or more.
Run mysql statement
SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;
search result

Save the query results
Windows found in mysql installation directorymy.ini file
Add below ** [mysqld] **
sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
This configuration
Delete after addingONLY_FULL_GROUP_BY
sql_mode = TRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
If you aremy.ini fileThere are sql_mode configuration in the file and in the configurationONLY_FULL_GROUP_BY Can be deleted directly
Remember to restart mysql after deleting it, otherwise the configuration cannot take effect
1. Reasons for the problem MySQL 5.7, realize the dependencies of detection functions. If it is enabledONLY_FULL_GROUP_BY SQL mode (default),MySQLRefuse to choose a list query, conditions, or command ...
1. Principle level This error occurred in the MYSQL 5.7 version and above. The default SQL configuration of MySQL 5.7 is: sql_mode = "only_full_group_by", which strictly executes the "S...
About sql_mode, you can view When sql_mode=ONLY_FULL_GROUP_BY, this sql will report an error. After clearing the value of sql_mode (the value of sql_mode in Alibaba Cloud RDS database is empty), the a...
mysql opens only_full_group_by mode. In this mode, using the old version of mysql to get group by group data will report an error, the error is as follows: `Expression #3 of SELECT list is not in GROU...
Check SET global Set the current library...
Check SQL_MODE results returned by mysql8 Remove the only_full_group_by this SQL_Mode, the operation is as follows: Then execute the SQL statement will not report an error, this is just modifying SQL_...
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by When executing a colleague's sql, I found that group by has a problem. select m...
Remember once, when you migrate the service, connect to the new database, the database is also the backup of the previous, found an error: I started thinking that it was wrong when I imported i...
MySQL reasonable set of sql_mode sql model used to solve the following types of problems (1) By setting sql mode, can perform different stringency data check, data preparation of effective protection....
Solution my.cnf adds a piece of data sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION service mysqld restart resta...