Home >Database >Mysql Tutorial >How to Disable the ONLY_FULL_GROUP_BY Mode in MySQL?

How to Disable the ONLY_FULL_GROUP_BY Mode in MySQL?

Susan Sarandon
Susan SarandonOriginal
2024-12-21 16:14:17937browse

How to Disable the ONLY_FULL_GROUP_BY Mode in MySQL?

Disabling ONLY_FULL_GROUP_BY Mode

Enabling ONLY_FULL_GROUP_BY mode can unintentionally restrict SQL queries. This article provides two solutions to disable it.

Solution 1: Using MySQL Console

Run the following command to remove ONLY_FULL_GROUP_BY from the SQL mode:

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

To make the setting persistent across restarts, use:

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

Solution 2: Using phpMyAdmin

  1. Open phpMyAdmin and select localhost.
  2. Click on "Variables" and scroll down to locate "sql mode."
  3. Click 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 to Disable the 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