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
Release: 2024-12-21 16:14:17
Original
1007 people have browsed it

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',''));
Copy after login

To make the setting persistent across restarts, use:

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

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template