The MySQL server can operate in different SQL modes, and can apply these modes differently for different clients, depending on the value of the sql_mode system variable. DBAs can set the global SQL mode to match site server operating requirements, and each application can set its session SQL mode to its own requirements.
Questions tagged [sql-mode]
102 questions
1
vote
0 answers
How to reset sql_mode at osx 10.11
I have a problem with this sql_mode
SQLSTATE[42000]: Syntax error or access violation:
1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated
column 'my_database_name.my_table.id' which is not functionally dependent…

Bobo Varga
- 11
- 2
1
vote
0 answers
MySQL problems with the group in the new versions
Good day.
Note:
In MySQL 5.7.0 and newer is included by default in ONLY_FULL_GROUP_BY sql_mode
The following query is not:
SELECT
`ordered_list`.*
FROM
(
SELECT
*
FROM
`test`
ORDER BY
…

fens
- 31
- 5
1
vote
2 answers
Data too long for column at row 1 mysql 5.6
I am using MySql 5.6 in production for my application. Now what happens is there is one field on the form in application which has data type char(2) table and its maximum length for input type is 25. Now when user types in characters more than 2 and…

mahendra kawde
- 855
- 4
- 25
- 44
1
vote
1 answer
How to rewrite a statement, that uses the MySQL Extensions to GROUP BY to a standard SQL statement?
It ueses the MySQL Extensions to GROUP BY and cannot be executed, if the sql_mode is set to ONLY_FULL_GROUP_BY.
-- SET sql_mode = ""; -- reset sql_mode and execute statement
SELECT
`courses`.`id` AS `id`,
`courses`.`title` AS `title`,
…

automatix
- 14,018
- 26
- 105
- 230
1
vote
1 answer
How to set sql_mode in Zend Framework 2?
I'm currently having an issue with pagination in Zend Framework 2.
This code
public function findAllByCriteria(CourseSearchInput $input) {
$concatDelimiter = self::CONCAT_DELIMITER;
$select = new Select();
$where = new Where();
…

automatix
- 14,018
- 26
- 105
- 230
1
vote
1 answer
ONLY_FULL_GROUP_BY not set but still have Error 1140
I am finalizing the implementation of my website but now I have a problem that occurs online that I have not locally.
I get this error:
failed: Mixing of GROUP columns (MIN (), MAX (), COUNT (), ...) with no GROUP columns is illegal if there is no…

Stevo32
- 11
- 1
- 3
1
vote
1 answer
disable sql-mode autocompletion in emacs
I'm trying to write my pl/sql code in following way: id_sel then hit TAB or Enter and I've got id_select completion! It works with any ...sel word. I think it is an sql-mode feature. How to disable this?

egor7
- 4,678
- 7
- 31
- 55
0
votes
1 answer
SQL_MODE is not being changed
I have the latest mysql version, also i'm using HeidiSQL.
I've edited my.ini
[mysqld]
sql_mode = ''
I've restarted the mysql server and when I query SELECT @@GLOBAL.sql_mode; I get again…

Galbert
- 177
- 1
- 8
0
votes
1 answer
Same tables and structure gives overload error on other schema
I have a simple insert to the table with a smallint(6). Now on our newest schema, the table structure gives an overload error when inserting a value over 32767 into that field.
At the same time on the same instance and with the same table structure…

Tim
- 1
- 1
0
votes
0 answers
mysql insert null data into NOT NULL column
I'm confused when inserting null data (records with null field) into NOT NULL columns.
The mysql table disables STRICT-SQL-MODE.
According to thess two docs, it was supposed to work but the truth is…

PengPeng
- 1
- 2
0
votes
1 answer
I have a problem with MySQL and Django on Docker: "sql_mode=only_full_group_by"
"Expression #3 of SELECT list is not in GROUP BY clause and contains
nonaggregated column 'database_name.i.id' which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by"
Hi, sorry for…

Alonso
- 1
0
votes
0 answers
Query not working with sql_mode ONLY_FULL_GROUP_BY
I am trying to make this query working with the sql_mode ONLY_FULL_GROUP_BY instead of disable it as it seems not to be a good practice.
I tried to use ANY_VALUE() function but it is not recognized. I get this error :
[Syntax Error] line 0, col 13:…

Melody
- 74
- 10
0
votes
0 answers
What is MySQL default mode setting?
I ‘m using MySQL 5.7.8. I find this document https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html and it said that
The default SQL mode in MySQL 5.7 includes these…

Ryannnnnnnnn
- 7
- 3
0
votes
1 answer
MYSQL sql_mode Keeps reseting after mysql restart
Setup
mysql Ver 14.14 Distrib 5.7.38, for Linux (x86_64) using EditLine wrapper
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
MYSQL Keeps reseting my sql_mode and so my website is not working…

Konstantinos Natsios
- 2,874
- 9
- 39
- 74
0
votes
1 answer
What is the correct way to set sql-mode permanently for MySQL 8 on Ubuntu 20.04?
I have a fresh LEMP stack installed on a Digital Ocean Ubuntu 20.04 with MySQL 8.
From the command line I see the default sql_mode is set as:
ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO,…

user1729972
- 712
- 2
- 9
- 29