0

I have a PHP application hosted on a windows server 2008 R2 machine.

I had a problem with strict mode in MySQL and solved it by disabling the strict mode using the following command

set GLOBAL.sql_mode='';

When I restart the machine, strict mode is enabled again and the problem exists again.

How can I solve this issue ?

Edit:

In addition to @Jérémy Munoz's answer, you have to restart the MySQL service using the following commands:

net stop MySQL

then

net start MySQL
Hazem Taha
  • 111
  • 4
  • 1
    By reading the [documentation](http://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sql-mode-setting)? – Sven Mar 09 '15 at 12:46

3 Answers3

2

Add this : sql-mode="what you want" below [mysqld] in the my.cnf configuration file.

René Höhle
  • 1,438
  • 3
  • 17
  • 26
Jérémy Munoz
  • 344
  • 2
  • 8
0

Write the command into the MySQL Server config file.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
Sven
  • 98,649
  • 14
  • 180
  • 226
  • Of course I tried this approach, I wrote sql-mode="" but did not work. Still losing changes after restarting. – Hazem Taha Mar 09 '15 at 13:03
0

I had a similar problem. It happened that there were several my.cnf files in system. One in /etc/mtsql and other in /usr/. And latter had bad parameters.

Ivan Ivanov
  • 101
  • 2