Topic: MySQL Strict Mode is not supported

Just started the installation process and noticed this was the only item highlighted in red.  Is this an important issue and if so how do I fix this?  I have my own dedicated server, but I'm still a work in progress as far as setting it up right and such. 
Nootkan

For the Fish!
Nootkan

Re: MySQL Strict Mode is not supported

Yes this important.  You need to disable MySQL Strict mode for proper operation of Mia.  If you run a Yahoo/Google search you'll find the process for during this.  There are a few ways.

Here is the official MySQL page about Strict mode and he is another wiki page that talks about disabling it.

http://brilaps.com
http://opensourcepenguin.net

Re: MySQL Strict Mode is not supported

I don't have mysql 5 (4.1.22-standard) or php 5 (4.4.8) does this make a difference. 

Other settings are:

Safe Mode:  OFF 
Open basedir:  none 
Display Errors:  ON 
Short Open Tags:  ON 
File Uploads:  ON 
Magic Quotes:  ON 
Register Globals:  OFF 
Output Buffering:  OFF 
Session save path:  /tmp 
Session auto start:  0 
XML enabled:  Yes 
Zlib enabled:  Yes 
Disabled Functions:  show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open, fsockopen, socket_create

So far mia seems to be working fine.
Nootkan

For the Fish!
Nootkan

Re: MySQL Strict Mode is not supported

nootkan wrote:

So far mia seems to be working fine.

If the install went ok you should be good to go.  Normally MySQL Strict problems arise just during installation.

http://brilaps.com
http://opensourcepenguin.net

Re: MySQL Strict Mode is not supported

Hi

I experienced this Strict Mode issue as well and since it was a test installation on my local machine, I decided to proceed with the process without disabling that setting.  Unsurprisingly, the installation was terminated prematurely with this message: 

Looks like there have been some errors with inserting data into your database! You cannot continue.

and the following error log was generated:

SQL=BLOB/TEXT column 'text' can't have a default value:
- - - - - - - - - -
# Table structure for table `mia_poll_data`
CREATE TABLE `mia_poll_data` (
  `id` int(11) NOT NULL auto_increment,
  `pollid` int(4) NOT NULL default '0',
  `text` text NOT NULL default '',
  `hits` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `pollid` (`pollid`,`text`(1))
) TYPE=MyISAM
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
# Dumping data for table `mia_poll_data`
INSERT INTO `mia_poll_data` VALUES (20, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (19, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (18, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (17, 15, 'Scott Adams', 1)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (16, 15, 'Tim Berners-Lee', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (15, 15, 'Linus Torvalds', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (14, 15, 'Bill Gates', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (13, 15, 'Steve Jobs', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (21, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (22, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (23, 15, '', 0)
= = = = = = = = = =
SQL=Table 'miacms_db.mia_poll_data' doesn't exist:
- - - - - - - - - -
INSERT INTO `mia_poll_data` VALUES (24, 15, '', 0)
= = = = = = = = = =

This raises a serious question.  What happens if a user does not have administrative rights to alter the Strict Mode setting?  A possible answer to this is that the user, if dealing with a hosting company, can simply request that action be taken. If the host is uncooperative, the subscriber can switch to a more accommodating provider.

The problem with this scenario is that it practically forces an idividual to make possibly highly disruptive changes.  I have performed numerous full or test installations using other CMS, Wikis, Learning Management Systems, Shopping Cart Systems, Blogging Engines, Forums, etc which use a MySQL database and none have required Strict Mode to be disabled. 

The folks at MySQL evidently saw the merits of having this setting enabled and based on my experience its appears that most system developers have designed their frameworks to be compliant.  When can we expect MiaCMS to become compatible?

Regards

Licensed to thrill

Re: MySQL Strict Mode is not supported

You can expect a major overhaul of the entire system after version 4.8 (meaning it will happen in 5.0).  The issue is actually pretty easy to solve.  I think I even posted a revised SQL file when I was still running Mambo.  Just don't have it anymore.  If you follow each error it is pretty clear as to what should be changed and you can actually get a good bit of the way there by opening the installation sql file and replacing all occurrences of:

NOT NULL default ''

with

NOT NULL

When time permits I'll see if I can work up a new file for everyone.

http://brilaps.com
http://opensourcepenguin.net

Re: MySQL Strict Mode is not supported

cauld wrote:

You can expect a major overhaul of the entire system after version 4.8 (meaning it will happen in 5.0).

Good stuff! Hope to see it happen smile.

cauld wrote:

The issue is actually pretty easy to solve.  I think I even posted a revised SQL file when I was still running Mambo.  Just don't have it anymore.  If you follow each error it is pretty clear as to what should be changed and you can actually get a good bit of the way there by opening the installation sql file and replacing all occurrences of:

NOT NULL default ''

with

NOT NULL

When time permits I'll see if I can work up a new file for everyone.

Yep I figured out as much.  Actually only one instance needs to be altered.

In ../installation/miacms/sql/miacms.sql find (in line 566, the "#__poll_data" table creation query)

`text` text NOT NULL default '',

and change it to:

`text` text NOT NULL,

I am just wondering though how would this impact on the further functionality of the system and whether ther are any known issues with Strict Mode and any MiaCMS extensions.

Regards

Last edited by jazz (2008-10-10 13:27:25)

Licensed to thrill

Re: MySQL Strict Mode is not supported

jazz wrote:

I am just wondering though how would this impact on the further functionality of the system and whether ther are any known issues with Strict Mode and any MiaCMS extensions.

Once installed successfully all should be well.  The big issue is really just with the installation.  If an extension requires a new table then the extension author must code the CREATE TABLE statement in accordance with strict mode.  Basic SQL statements made by the core and/or the extensions thereafter should be fine.  Like I said we'll do some reworking and heavy QA once 5 rolls around, but I don't think you'll have any issues.

http://brilaps.com
http://opensourcepenguin.net

Re: MySQL Strict Mode is not supported

cauld wrote:

Once installed successfully all should be well.  The big issue is really just with the installation.

Apparently this is not the case.  I successfully completed the installation with Strict Mode enabled by editing the ../installation/sql/miacms.sql file, however  some problems were experienced in the  back-end.  These were solved by disabling Strict Mode.  The thread outlining the issues and solution can be viewed there http://forum.miacms.org/viewtopic.php?id=497.

Regards

Licensed to thrill

Re: MySQL Strict Mode is not supported

Jazz, thanks for the followup.  This will be useful when we tackle for v5.

http://brilaps.com
http://opensourcepenguin.net

Re: MySQL Strict Mode is not supported

Ok cauld, looking forward to the Strict Mode support smile.

Cheers

Licensed to thrill

Re: MySQL Strict Mode is not supported

MySQL code is needed for most online website to work in efficient way.

Last edited by UKEcommerce (2010-06-13 08:27:01)