Home >Database >Mysql Tutorial >How Do I Disable 'ONLY_FULL_GROUP_BY' Mode in MySQL?

How Do I Disable 'ONLY_FULL_GROUP_BY' Mode in MySQL?

Barbara Streisand
Barbara StreisandOriginal
2024-12-18 05:07:14257browse

How Do I Disable

Undoing the Effects of "ONLY_FULL_GROUP_BY" Mode

In a moment of inadvertence, you activated "ONLY_FULL_GROUP_BY" mode using the command "SET sql_mode = 'ONLY_FULL_GROUP_BY';." To restore functionality, you'll need to disable this setting.

Solution 1: Deactivate via MySQL Console

From the MySQL console, run the following command:

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

This removes "ONLY_FULL_GROUP_BY" from the global sql_mode setting. However, the change is not persistent across restarts. To make it permanent, use:

mysql > SET PERSIST sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Solution 2: Deactivate via phpMyAdmin

  1. Open phpMyAdmin and select the "localhost" connection.
  2. Navigate to the "Variables" tab and scroll down to find "sql mode".
  3. Click on the "Edit" button and remove "ONLY_FULL_GROUP_BY" from the values.
  4. Click "Save" to apply the changes.

The above is the detailed content of How Do I Disable 'ONLY_FULL_GROUP_BY' Mode in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn