From d49f764bbc1ffad4501e0bd9d36e40ddf9f54b00 Mon Sep 17 00:00:00 2001 From: David Rimbault Date: Mon, 5 May 2014 23:45:02 +0200 Subject: [PATCH 1/2] Updated README With MySQL 5.6 default configuration is more strict and adds STRICT_TRANS_TABLES. Added some info to configure MySQL properly. Better solution would be to make the schema correctly, defining optional columns as nullable. --- Readme.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Readme.md b/Readme.md index 0db651e8f..bb1a8c456 100644 --- a/Readme.md +++ b/Readme.md @@ -40,6 +40,27 @@ export PATH=/Applications/MAMP/bin/php/php5.4.x/bin/:$PATH * configure a complete development environment : http://php-osx.liip.ch/ * use a virtual machine with vagrant and puppet : https://puphpet.com/ +As of MySQL 5.6, default configuration sets the sql_mode value to + +``` +STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION +``` + +This 'STRICT_TRANS_TABLES' configuration results in SQL errors when no default value is defined on NOT NULL columns and the value is empty or invalid. + +You can edit this default config in ` /etc/my.cnf ` and change the sql_mode to remove the STRICT_TRANS_TABLES part + +``` +[mysqld] +sql_mode=NO_ENGINE_SUBSTITUTION +``` + +Assuming your sql_mode is the default one, you can change the value directly on the run by running the following SQL Command + +```sql +SET @@GLOBAL.sql_mode='NO_ENGINE_SUBSTITUTION', @@SESSION.sql_mode='NO_ENGINE_SUBSTITUTION' +``` + Installation ------------ From 4d177d70f48fee0fa44cf6c1dd2c79a99e07f91a Mon Sep 17 00:00:00 2001 From: David Rimbault Date: Mon, 5 May 2014 23:56:44 +0200 Subject: [PATCH 2/2] One little modification on formatting --- Readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Readme.md b/Readme.md index bb1a8c456..921ccce47 100644 --- a/Readme.md +++ b/Readme.md @@ -40,6 +40,8 @@ export PATH=/Applications/MAMP/bin/php/php5.4.x/bin/:$PATH * configure a complete development environment : http://php-osx.liip.ch/ * use a virtual machine with vagrant and puppet : https://puphpet.com/ +### MySQL 5.6 + As of MySQL 5.6, default configuration sets the sql_mode value to ``` @@ -61,6 +63,8 @@ Assuming your sql_mode is the default one, you can change the value directly on SET @@GLOBAL.sql_mode='NO_ENGINE_SUBSTITUTION', @@SESSION.sql_mode='NO_ENGINE_SUBSTITUTION' ``` +For more information on sql_mode you can consult the [MySQL doc](http://dev.mysql.com/doc/refman/5.0/fr/server-sql-mode.html "sql Mode") + Installation ------------