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
129
votes
14 answers
Setting global sql_mode in MySQL
I am trying to set sql_mode in MySQL but it throws an error.
Command:
set global sql_mode='NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLE','NO_AUTO_CREATE_USER','NO_ENGINE_SUBSTITUTION'
Is this not the proper way to set multiple modes?
What are the…

JPro
- 6,292
- 13
- 57
- 83
37
votes
4 answers
MySQL: Setting sql_mode permanently
Via the MySQL command line client, I am trying to set the global mysql_mode:
SET GLOBAL sql_mode = TRADITIONAL;
This works for the current session, but after I restart the server, the sql_mode goes back to its default: '', an empty string.
How can…

George Newton
- 3,153
- 7
- 34
- 49
27
votes
8 answers
How to set sql_mode in my.cnf in MySQL 8?
I'm running MySQL 8.0.11 community version. I need to set sql_mode to exclude ONLY_FULL_GROUP_BY in my.cnf so that it's restart safe. I tried the following variants:
sql_mode=…

RayCh
- 571
- 3
- 8
- 17
24
votes
4 answers
How do I connect to SQL Server using Emacs?
What steps do I take? Any gotchas to be aware of or tips to enhance the IDE experience that are specific to SQL Server when using Emacs?

Ray
- 187,153
- 97
- 222
- 204
24
votes
7 answers
How to get rid of STRICT SQL mode in MySQL
This is a follow up to this question MYSQL incorrect DATETIME format
How to get rid of STRICT_TRANS_TABLES once and for all?
mysql --help reports the following configs:
Default options are read from the following files in the given…

firedev
- 20,898
- 20
- 64
- 94
10
votes
1 answer
sql-set-sqli-buffer "there is no suitable sqli buffer"
I'm new to emacs and not very used to lisp so this is probably a newby error but i can't find the solution.
I try to install the sql mode to interact with my mysql DB.
To do so, I modified the sql.el file to precise the sql-user, sql-password,…

fatbob
- 243
- 4
- 12
9
votes
2 answers
How to set Amazon RDS SQL_MODE with multiple values
MySQL allows parameter SQL_MODE to be set to multiple values in the my.cnf file. How can I do the same on Amazon RDS?
UPDATE: This problem has been fixed...see below.

jago
- 457
- 3
- 7
- 15
8
votes
4 answers
How can I get emacs sql-mode to use the mysql config file (.my.cnf)?
When I type mysql dbname at the bash prompt, I automatically connect to the database dbname with the username, password, and host information included in my .my.cnf file.
When I use M-x sql-mysql in emacs, I am asked for all of this information…

David LeBauer
- 31,011
- 31
- 115
- 189
8
votes
8 answers
Emacs, sql-mode, Postgresql and inputing password
I'm trying to connect to a PostgreSQL DB thru Emacs using the sql-mode.
I start Emacs, command M-x sql-postgres and it prompts for User,
Database and Server but not for the password. An empty buffer opens
and whatever I write, I get:
the Password…

James Brown
- 36,089
- 7
- 43
- 59
7
votes
3 answers
Emacs how to use ssh tunnel to connect to remote MySQL
I have a bunch of remote MySQL servers, that allow connection only from localhost. To connect to them I do the following:
ssh host
mysql -uuser -psecret -hhost.myhost.com
In emacs I configured the connection to local MySQL, using…

user4035
- 22,508
- 11
- 59
- 94
6
votes
1 answer
Is it safe for me to turn off STRICT_TRANS_TABLES?
My PHP/mySQL backend hosted on an external site has been running fine since 2014. Recently, it started throwing up "field has no default value" errors.
I checked the config and found STRICT_TRANS_TABLES, which gives these errors for fields with no…

Almo
- 15,538
- 13
- 67
- 95
5
votes
3 answers
Can you create a new SQL buffer in Emacs if one already exists?
Let's say you have a *SQL* buffer already open in Emacs that is connected to a specific server and database. Now, your intention is to connect to a different server and database while keeping your other SQL buffer process active.
How exactly can…

Ray
- 187,153
- 97
- 222
- 204
5
votes
3 answers
Laravel Database Strict Mode
I'm little wonder please help me out.
My query is :- Invoice::join('orders', 'orders.invoice_id', '=', 'invoices.id')->groupBy('invoices.id')->get();
Then I have got an error: Syntax error or access violation: 1055 'invoices.reference_number' isn't…

Dheeraj
- 73
- 1
- 1
- 7
5
votes
1 answer
How to set the SQL Mode on a MySQL connection in JetBrains DataGrip
Does JetBrains DataGrip have any way to allow me to set the SQL_MODE automatically for my connection to a MySQL database?
For example, MySQL Workbench has a specific field for the connection that would set the SQL_MODE. Whilst HeidiSQL provide a…

Courtney Miles
- 3,756
- 3
- 29
- 47
5
votes
3 answers
1292: Incorrect datetime value: '' for column at row 1
I am trying to load data from excel sheet to the below table on MYSQL 5.6 on windows 8.1 and I am getting 'Incorrect datetime value:' error.
Term date column is of DATETIME data type and the data has null values in the excel sheet which I am trying…

Mithun Raj
- 51
- 1
- 1
- 2