The perfect solution for MySql version problem sql_mode=only_full_group_by

The perfect solution for MySql version problem sql_mode=only_full_group_by

1. Check sql_mode

select @@sql_mode

The queried value is:

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

2. Remove ONLY_FULL_GROUP_BY and reset the value.

set @@sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER
,NO_ENGINE_SUBSTITUTION';

3. The above changes the global sql_mode, which is valid for newly created databases. For an existing database, you need to execute the following command under the corresponding data:

set sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

The above is the perfect solution to the MySql version problem sql_mode=only_full_group_by introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Reasons and solutions for MySQL sql_mode modification not taking effect
  • Detailed explanation of MySQL sql_mode query and setting
  • Detailed explanation of viewing and setting SQL Mode in MySQL
  • Detailed explanation of sql_mode mode example in MySQL
  • Django2 connects to MySQL and model test example analysis
  • Detailed explanation on reasonable settings of MySQL sql_mode
  • MySQL sql_mode analysis and setting explanation
  • The pitfalls and solutions caused by the default value of sql_mode in MySQL 5.7
  • Solve the MySQL 5.7.9 version sql_mode=only_full_group_by problem
  • Detailed explanation of SQL Mode usage in MySQL
  • mysql sql_mode="" function description
  • Detailed explanation of the use of MySQL sql_mode

<<:  How to use JSX to implement Carousel components (front-end componentization)

>>:  Explanation of the new feature of Hadoop 2.X, the recycle bin function

Recommend

JavaScript to achieve a simple message board case

Use Javascript to implement a message board examp...

Vue imports Echarts to realize line scatter chart

This article shares the specific code of Vue impo...

Example of writing mobile H5 to invoke APP (IOS, Android)

iOS 1. URL scheme This solution is basically for ...

MySql import CSV file or tab-delimited file

Sometimes we need to import some data from anothe...

Detailed explanation of crontab scheduled execution command under Linux

In LINUX, periodic tasks are usually handled by t...

A link refresh page and js refresh page usage examples

1. How to use the link: Copy code The code is as f...

A brief discussion on whether too many MySQL data queries will cause OOM

Table of contents Impact of full table scan on th...

How to set static IP in CentOS7 on VirtualBox6 and what to note

Install CentOS 7 after installing VirtualBox. I w...

Ideas and codes for implementing Vuex data persistence

What is vuex vuex: is a state manager developed s...

How to use Docker-compose to build an ELK cluster

All the orchestration files and configuration fil...

How to deploy code-server using docker

Pull the image # docker pull codercom/code-server...

A brief discussion on the correct approach to MySQL table space recovery

Table of contents Preliminary Notes Problem Repro...

Steps for Docker to build its own local image repository

1. Environment and preparation 1. Ubuntu 14.04 2....