Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04 / ~#root -i
  • RU
  • UA
  • EN
  • Create an online store
  • Documentation
  • Blog
    • Unix ОS
    • Php
    • MySQL
    • JavaScript
    • Package Managers
    • Docker
    • Seo
  • Auxiliary services
    • Short Links
    • Exchange views YouTube
  • Sign in
  • Create Account
  • Home
  • MySQL
  • Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04

Disabling sql_mode=only_full_group_by in mysql 5.7 ubuntu 18.04

Sometimes it happens that you need to start an old site on new software. In my case, a site running on mysql 5.5 needed to be debugged on mysql 5.7. There was also an error "42000":

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'db.books' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

This is all due to the fact that mysql 5.7 introduced rules that, in order to speed up work with the database, prevent some queries from working (if I understood correctly). In production, this request should be rewritten. Because performance will be lost. But on a locale, you can perform the actions described below.

Tried for Ubuntu 18.04, mysql 5.7 (as I wrote above).

Add the following lines to the end of the /etc/mysql/my.cnf file:

sudo nano /etc/mysql/my.cnf

Enter at the end :

[mysqld]
sql_mode="NO_ENGINE_SUBSTITUTION"

restart mysql

sudo service mysql stop

sudo service mysql start

A warning

Initially, in 5.7 sql_mode, the following keys work:

STRICT_TRANS_TABLES, ONLY_FULL_GROUP_BY, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

With our action, we disable all keys, driving mysql 5.7 into a non-standard mode of operation, similar to mysql 5.6 version.

Don't use this in production.

20 December 18
2840
0

Comments

Name
E-mail
Rating
Review

Other articles from the category

06 April 2020

The length of the word in a FULLTEXT search. The size of the ft_min_word_len key.

The number of characters in a word when searching for a FULLTEXT key. The ft_min_word_len parameter.

01 September 2019

Mysql database of tires and disks

Base of automobile tires and disks. The database contains: manufacturer, model, year, modification, PCD, diameter, nut, tire and wheel factory sizes, possible replacement options, tire and wheel tuning. There are no trucks in the database.

30 March 2019

MySql 5.7 first setup, change root password and password length

Consider setting up MySql 5.7 access on Ubuntu 18.04. Let's define the mysql root user on the local machine, set the root password for him, consider changing the password length and restrictions on it.

Categories

  • Unix OS
  • Php
  • MySQL
  • JavaScript
  • Package Managers
  • Docker
  • Seo

Latest comments

Добрый день, Сергей. Я на более новых версиях блют...
root-i
23.02.23
Пробовал на transmart колонке. Ничего из перечисле...
Сергей
20.02.23
HenryMit, может быть
root-i
07.02.23
Неофрейдизм — это… Определение, принципы, представ...
HenryMit
07.02.23

I share information in which I needed help and spent a lot of time figuring it out. If the information helped at least one person, then this site was not created in vain.

Thank you for the continuation of the site:
Contacts

Telegram Viber Mail

Search for articles

  • Sign in
  • Create Account

Powered by chmod -R