How to Disable Strict mode in Mysql

You can just set:
Code:
sql_mode=

In /etc/my.cnf.d/server.cnf under [mysqld] section.
 
Check /usr/local/mysql/my.cnf for the sql_mode setting and comment it in that file
 
MySQL configuration file in my server was in /etc/my.cnf, so you might need to put sql_mode= in that file.
 
Don't use space. Just add in the file: /etc/my.cnf
MariaDB older than 10.6 or MySQL 5.7

Below: [mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION

Mariadb 10.6 or higher
sql_mode=
Mysql 5.7 or higher needs quotes:
sql-mode=""

Restart mysql/mariadb

Or login via CLI
To check mode:
SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;
And set them:
SET GLOBAL sql_mode = '';
SET sql_mode = '';
 
I fixed it with this configuration in my.cnf. Can both backup the database (dump) and fix the "Disable Strict" error. And it has optimized settings, you can refer to it under "key_buffer_size"

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include *.cnf from the config directory
#
#!includedir /etc/my.cnf.d

[mysqld]
max_allowed_packet=64M
local-infile=0
innodb_file_per_table
#skip-grant-tables
innodb_default_row_format=dynamic

sql_mode =

key_buffer_size = 384M #400M #384M

max_allowed_packet = 50M #2M #1M

sort_buffer_size = 3M #2M #8M #2M #8M #2M

read_buffer_size = 3M #2M #8M #2M #8M #2M

read_rnd_buffer_size = 8M #16M #8M #16M #8M

myisam_sort_buffer_size = 96M #64M #96M #64M #128M #64M

thread_cache_size = 8

query_cache_size = 600M #128M #500M #400M #300M #150M #256M #128M #32M #128M #50M #256M #50M #32M
 
I fixed it with this configuration in my.cnf. Can both backup the database (dump) and fix the "Disable Strict" error. And it has optimized settings, you can refer to it under "key_buffer_size"

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include *.cnf from the config directory
#
#!includedir /etc/my.cnf.d

[mysqld]
max_allowed_packet=64M
local-infile=0
innodb_file_per_table
#skip-grant-tables
innodb_default_row_format=dynamic

sql_mode =

key_buffer_size = 384M #400M #384M

max_allowed_packet = 50M #2M #1M

sort_buffer_size = 3M #2M #8M #2M #8M #2M

read_buffer_size = 3M #2M #8M #2M #8M #2M

read_rnd_buffer_size = 8M #16M #8M #16M #8M

myisam_sort_buffer_size = 96M #64M #96M #64M #128M #64M

thread_cache_size = 8

query_cache_size = 600M #128M #500M #400M #300M #150M #256M #128M #32M #128M #50M #256M #50M #32M
that's a very odd configuration, plus, optimized values for you, are not the same for me or anyone else.

it depends on servers specs, and mysql load of your users.
 
that's a very odd configuration, plus, optimized values for you, are not the same for me or anyone else.

it depends on servers specs, and mysql load of your users.
Yes, I get it. I also explain that You do not need configuration from this line down
key_buffer_size = 384M #400M #384M...


Note that this configuration allows backups. I encountered an error with the SQL backup issue when setting additional values
sql_mode =
 
Back
Top