How to change MySQL mode / Remove ONLY_FULL_GROUP_BY?

How to change MySQL mode / Remove ONLY_FULL_GROUP_BY?

Method 1:

Remove ONLY_FULL_GROUP_BY from MySQL console
mysql >SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
-----------------------------------------------------------------

Method 2: (ubuntu commands)

  1. sudo nano /etc/mysql/my.cnf

  2. [mysqld]  
    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. sudo service mysql restart to restart MySQL

    This will disable ONLY_FULL_GROUP_BY for ALL users

-----------------------------------------------------------------

Method 3: (Easy)

  1. Log into your server as root

  2. Get script wget https://gist.githubusercontent.com/nfourtythree/90fb8ef5eeafdf478f522720314c60bd/raw/disable-strict-mode.sh

  3. Make is executable chmod +x disable-strict-mode.sh

  4. Run the script ./disable-strict-mode.sh

  5. DONE!

You can keep the script where you downloaded it for future mods or references or you can rm -rf disable-strict-mode.sh and delete the shell script.

You will then have MySQL 5.7 without strict mode.

DISCLAIMER: Not sure if it works with version 8.0

 

Ця відповідь Вам допомогла?

 Роздрукувати цю статтю

Також прочитайте

HOW TO INCREASE FILE UPLOAD SIZE IN ZPANEL / SENTORA

Increasing Max Upload Size in ZPanel / SENTORA / Linux VPS / CentOs 6 ZPanel / Sentora server...

How to start own Internet radio station?

Internet Radio HostingStart your very own radio station online - [VIEW PLANS] Effectively make...

How to redirect old URL to new URL ?

Step 1:  Create/Edit a file .htaccess in the documbent root (public_html / www folder)of your...

How to redirect domain with www ?

Step 1:  Create/Edit a file .htaccess in the documbent root (public_html / www folder)of your...

How to force all web traffic to use HTTPS ?

// // SSL Certificate Properly Installed & Working Require, To Use It.If you've no SSL...