PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Documentation Wiki

Disabling strict mode in MySQL 5


PostNuke versions prior to version 0.8.0.0 will ecounter a problem when running on MySQL 5 with strict mode enabled. This SQL server mode, new in MySQL 5, enforces stricter SQL statements that found in any previous MySQL version.

To check the current SQL server mode issue the SQL command either from the MySQL command line or from phpmyadmin.

SELECT @@global.sql_mode;


The result of this will be a list of server modes in use at the moment. The following result is from a default MySQL 5 setup.

+-------------------------------------------------------------------------------
------------------------------------------------+
| @@global.sql_mode
                                                |
+-------------------------------------------------------------------------------
------------------------------------------------+
| STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_D
IVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER |
+-------------------------------------------------------------------------------
------------------------------------------------+
1 row in set (0.00 sec)


To disable the modes that affect operation of PostNuke 0.7.x issue the following SQL command

SET @@global.sql_mode='MYSQL40'


Issue the first SQL command again to check that the server mode has been successfully changed.

+----------------------------------------------+
| @@global.sql_mode                            |
+----------------------------------------------+
| NO_FIELD_OPTIONS,MYSQL40,HIGH_NOT_PRECEDENCE |
+----------------------------------------------+
1 row in set (0.00 sec)


It should be noted that this SQL statement doesn't fix the problem but is a workaround that reduces the level of 'correctness' required in SQL statements supplied to MySQL. PostNuke 0.8.0.0 will run correctly using MySQL 5 strict mode.



Back to the Knowledge Base

CategoryKnowledgeBase
XML Revisions of $tag
Page history :: Last Editor [ markwest ] :: Owner [ markwest ] ::
Valid XHTML :: Valid CSS :: Powered by pnWikka 1.0 (A wiki fork from WikkaWiki)
 

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke