I want to know how to check whether MySQL strict mode is on or off in localhost(xampp).
If on then for what modes and how to off.
If off then how to on.
In my case, I need to add:
sql_mode="STRICT_TRANS_TABLES"
under [mysqld]
in the file my.ini
located in C:\xampp\mysql\bin
.
on Debian 10
I start mysql from ./opt/lampp/xampp start
I do strace ./opt/lampp/sbin/mysqld
and see that my.cnf is there:
stat("/opt/lampp/etc/my.cnf", {st_mode=S_IFREG|0644, st_size=5050, ...}) = 0
openat(AT_FDCWD, "/opt/lampp/etc/my.cnf", O_RDONLY|O_CLOEXEC) = 3
hence, I add sql_mode config to /opt/lampp/etc/my.cnf
instead of /etc/mysql/my.cnf
To Change it permanently in ubuntu do the following
in the ubuntu command line
sudo nano /etc/mysql/my.cnf
Then add the following
[mysqld]
sql_mode=
You can check the local and global value of it with:
SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE;
on server console:
$ mysql -u root -p -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';"