Recent Topics

1 Dec 01, 2005 23:46    

First things first... I'm running Windows 2003 with PHP 5.1.1 and MySQL 5.0.16. I've tried this with both version 0.9.1 and 1.6.

I created a new database using phpMyAdmin, enterted that information into the /install part of the install, and then clicked next. It creates the tables but throws this error at me (this is when I try version 1.6... if I try 0.9.1 it throws the same error at me (but in a different spot)). Can someone offer me some advice? I'm a PHP and MySQL newb so be easy on me :)

Here is the error:

Installing b2evolution tables with sample data
Creating table for Groups... OK.
Creating default groups... OK.
Creating table for Blog-User permissions... OK.
Creating table for Settings... OK.
Creating table for Users... OK.
Creating table for Blogs... OK.
Creating table for Categories... OK.
Creating table for Posts... OK.
Creating table for Categories-to-Posts relationships... OK.
Creating table for Comments... OK.
Creating table for Antispam Blackist... OK.
Creating default blacklist entries... OK.
Creating table for Locales... OK.
Creating table for active sessions... OK.
Creating user settings table... OK.
Creating plugins table... OK.
Creating table for Post Statuses... OK.
Creating table for Post Types... OK.
Creating default Post Types... OK.
Creating table for File Meta Data... OK.
Creating table for Post Links... OK.
Creating table for base domains... OK.
Creating table for user agents... OK.
Creating table for Hit-Logs... OK.
Creating table for subscriptions... OK.
Creating table for blog-group permissions... OK.
Creating default blogs...
MySQL error!

Field 'blog_media_subdir' doesn't have a default value(Errno=1364)

Your query:

INSERT INTO evo_blogs( blog_name, blog_shortname, blog_siteurl,
blog_stub, blog_urlname, blog_staticfilename,
blog_tagline, blog_description, blog_longdesc, blog_locale, blog_notes, blog_keywords,
blog_UID, blog_allowcomments, blog_allowtrackbacks, blog_allowpingbacks, blog_pingb2evonet,
blog_pingtechnorati, blog_pingweblogs, blog_pingblodotgs, blog_disp_bloglist,
blog_in_bloglist, blog_links_blog_ID )
VALUES ( 'Blog All Title', 'Blog All', '', 'all', 'all', 'all.html', 'Tagline for Blog All', 'Short description for Blog All', 'This is the long description for the blog named \'Blog All\'. <br />\r\n<br />\r\n<strong>This blog (blog #1) is actually a very special blog! It automatically aggregates all posts from all other blogs. This allows you to easily track everything that is posted on this system. You can hide this blog from the public by unchecking \'Include in public blog list\' in the blogs admin.</strong>', 'en-US', 'Notes for Blog All', 'Keywords for Blog All', '', 'post_by_post', 1, 0, 0, 0, 1, 0, 1, 1, 4)Backtrace:
DB->print_error( "", "" )
File: C:\Inetpub\My Bodybuilding Blog\evocore\_db.class.php:557
DB->query( "INSERT INTO T_blogs( blog_name, blog_shortname, blog_siteurl, ..." )
File: C:\Inetpub\My Bodybuilding Blog\evocore\_blog.funcs.php:112
blog_create( "Blog All Title", "Blog All", "", "all", "all.html", "Tagline for Blog All", "Short description for Blog All", "This is the long description for the blog named 'Blog All'. <br ...", "en-US", "Notes for Blog All", "Keywords for Blog All", 4 )
File: C:\Inetpub\My Bodybuilding Blog\install\_functions_create.php:521
create_default_blogs()
File: C:\Inetpub\My Bodybuilding Blog\install\_functions_create.php:796
populate_main_tables()
File: C:\Inetpub\My Bodybuilding Blog\install\index.php:444
Ignored last: 1

2 Dec 02, 2005 00:02

If I try with version 0.9.1 this is the error I get when creating the database tables:

Installing b2evolution tables with sample data
Creating table for Groups... OK.
Creating default groups... OK.
Creating table for Blog-User permissions... OK.
Creating table for Settings... OK.
Creating table for Users... OK.
Creating table for Blogs... OK.
Creating table for Categories... OK.
Creating table for Posts... OK.
Creating table for Categories-to-Posts relationships... OK.
Creating table for Comments... OK.
Creating table for Hit-Logs... OK.
Creating table for Antispam Blackist... OK.
Creating default blacklist entries... OK.
Creating table for Locales... OK.
Creating default blogs... OK.
Creating sample categories... OK.
Creating sample posts for blog A... OK.
Creating default linkblog entries... OK.
Creating sample posts... OK.
Creating sample comments... OK.
Creating default users...
MySQL error!

Field 'user_firstname' doesn't have a default value(Errno=1364)

Your query:

INSERT INTO evo_users (user_login, user_pass, user_nickname, user_email, user_ip, user_domain, user_level, user_locale, dateYMDhour, user_grp_ID) VALUES ('admin', '9993d56abb9084ce3e805fa471dc238e', 'admin', 'kanderson@mybodybuildingblog.com', '127.0.0.1', 'localhost', 10, 'en-US', '2005-12-01 14:59:40', 1)

3 Dec 02, 2005 10:24

This is caused by MySQL strict mode.

We'll fix it in the DB schema.

You can work around this, by disabling "Strict mode" with MySQL 5 or install MySQL 4. I'd rather do the first.

Sorry.

4 Mar 20, 2006 19:39

Is there a patch available to fix this in the source? I'd rather not disable strict mode on the DB.

5 Mar 20, 2006 19:46

If anyone else is experiencing this, try replacing lines 85 - 157 in install/_functions_create.php with the following:

	echo 'Creating table for Users... ';
	$query = "CREATE TABLE T_users (
		user_ID int(11) unsigned NOT NULL auto_increment,
		user_login varchar(20) NOT NULL,
		user_pass CHAR(32) NOT NULL,
		user_firstname varchar(50) NOT NULL DEFAULT '',
		user_lastname varchar(50) NOT NULL DEFAULT '',
		user_nickname varchar(50) NOT NULL,
		user_icq int(11) unsigned DEFAULT 0 NOT NULL,
		user_email varchar(100) NOT NULL,
		user_url varchar(100) NOT NULL DEFAULT '',
		user_ip varchar(15) NOT NULL DEFAULT '',
		user_domain varchar(200) NOT NULL DEFAULT '',
		user_browser varchar(200) NOT NULL DEFAULT '',
		dateYMDhour datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
		user_level int unsigned DEFAULT 0 NOT NULL,
		user_aim varchar(50) NOT NULL DEFAULT '',
		user_msn varchar(100) NOT NULL DEFAULT '',
		user_yim varchar(50) NOT NULL DEFAULT '',
		user_locale varchar(20) DEFAULT 'en-EU' NOT NULL,
		user_idmode varchar(20) NOT NULL DEFAULT 'login',
		user_notify tinyint(1) NOT NULL default 1,
		user_showonline tinyint(1) NOT NULL default 1,
		user_grp_ID int(4) NOT NULL default 1,
		PRIMARY KEY user_ID (user_ID),
		UNIQUE user_login (user_login),
		KEY user_grp_ID (user_grp_ID)
	)";
	$DB->query( $query );
	echo "OK.<br />\n";


	echo 'Creating table for Blogs... ';
	$query = "CREATE TABLE T_blogs (
		blog_ID int(11) unsigned NOT NULL auto_increment,
		blog_shortname varchar(12) NULL default '',
		blog_name varchar(50) NOT NULL default '',
		blog_tagline varchar(250) NULL default '',
		blog_description varchar(250) NULL default '',
		blog_longdesc TEXT NULL DEFAULT NULL,
		blog_locale VARCHAR(20) NOT NULL DEFAULT 'en-EU',
		blog_access_type VARCHAR(10) NOT NULL DEFAULT 'index.php',
		blog_siteurl varchar(120) NOT NULL default '',
		blog_staticfilename varchar(30) NULL default NULL,
		blog_stub VARCHAR(255) NOT NULL DEFAULT 'stub',
		blog_urlname VARCHAR(255) NOT NULL DEFAULT 'urlname',
		blog_notes TEXT NULL,
		blog_keywords tinytext,
		blog_allowcomments VARCHAR(20) NOT NULL default 'post_by_post',
		blog_allowtrackbacks TINYINT(1) NOT NULL default 1,
		blog_allowpingbacks TINYINT(1) NOT NULL default 0,
		blog_allowblogcss TINYINT(1) NOT NULL default 1,
		blog_allowusercss TINYINT(1) NOT NULL default 1,
		blog_pingb2evonet TINYINT(1) NOT NULL default 0,
		blog_pingtechnorati TINYINT(1) NOT NULL default 0,
		blog_pingweblogs TINYINT(1) NOT NULL default 0,
		blog_pingblodotgs TINYINT(1) NOT NULL default 0,
		blog_default_skin VARCHAR(30) NOT NULL DEFAULT 'custom',
		blog_force_skin TINYINT(1) NOT NULL default 0,
		blog_disp_bloglist TINYINT(1) NOT NULL DEFAULT 1,
		blog_in_bloglist TINYINT(1) NOT NULL DEFAULT 1,
		blog_links_blog_ID INT(11) NULL DEFAULT NULL,
		blog_commentsexpire INT(4) NOT NULL DEFAULT 0,
		blog_media_location ENUM( 'default', 'subdir', 'custom', 'none' ) DEFAULT 'default' NOT NULL,
		blog_media_subdir VARCHAR( 255 ) NOT NULL DEFAULT '',
		blog_media_fullpath VARCHAR( 255 ) NOT NULL DEFAULT '',
		blog_media_url VARCHAR( 255 ) NOT NULL DEFAULT '',
		blog_UID VARCHAR(20),
		PRIMARY KEY blog_ID (blog_ID),
		UNIQUE KEY blog_urlname (blog_urlname)
	)";
	$DB->query( $query );
	echo "OK.<br />\n";

6 Mar 20, 2006 21:05

As said, I'd rather disable strict mode (and would guess that there were more things involved which I've fixed for this!).
You get no benefit from using it with b2evolution (when it breaks things).

Just add the following line to the constructor (function DB()) in _db.class.php:


		$this->query( 'SET sql_mode = ""' );

7 Mar 21, 2006 16:17

Thanks. I was finding other spots where the code above actually made things worse :(

8 Apr 07, 2006 14:24

I've tried this solution, but nothing happens. Heres some of the _class_db.php file:

function DB( $dbuser, $dbpassword, $dbname, $dbhost, $dbaliases, $halt_on_error = true, $db_use_transactions = false, $dbtableoptions = '' )
	{
		$this->query( 'SET sql_mode = ""' );
		$this->halt_on_error = $halt_on_error;


Is this the correct place for the $this->query( 'SET sql_mode = ""' );?

9 Apr 07, 2006 16:59

BroderOle, you should rather put it at the end of the constructor, AFTER the connection has been established.

That should help.

10 Jul 25, 2006 15:49

Is this fix still valid for the latest Summer Beta release?

11 Jul 25, 2006 19:07

xangelusx, there shouldn't be such errors anymore..

What MySQL version are you using? What error do you get?

12 Jul 25, 2006 19:24

Still merging changes so I haven't tried to access the latest version yet. Just asking in case I didn't need to merge that change, or in case the method for running said query has changed.

We are running MySQL 5.0 though. I'll post any error messages that occur, if they occur.

Thanks!

13 Jul 25, 2006 19:36

I'm running MySQL 5 myself for testing, in "strict mode". So there should be no problems.

14 Jul 25, 2006 19:41

Thanks, I'll give it a try!

15 Jul 25, 2006 21:32

OK, Just tried to upgrade the DB using the base source code and got an erro message about truncated data after the following line:

Altering table «evo_hitlog»...

* Changed type of evo_hitlog.hit_referer_type from enum('search','blacklist','referer','direct','spam') to hit_referer_type ENUM('search','blacklist','referer','direct') NOT NULL

Adding $this->query( 'SET sql_mode = ""' ); back in resolved the issue.

16 Jul 25, 2006 21:40

Hmm.. this seems to mean that you have at least one column in T_hitlogs which has hit_referer_type = "spam" (or NULL?!).. can you please check this?

Is it correct that you got the error during upgrade? Or afterwards when a hit got logged?

17 Jul 25, 2006 21:46

It was during upgrade. Unfortunatly I just wiped out all of the old tables so I can't see what was in there. Sorry! i know that doesn't help debug :(

18 Jul 25, 2006 21:53

I suppose it has been one or more rows with "spam" in it.

At least, this MySQL is something that appears if you insert something into an ENUM field, which is not allowed/defined. In non-strict mode it probably just inserts the default/NULL then.

However, apart from that, during normal operation, you should not need the

SET sql_mode=""

part.

But it does no harm really either.


Form is loading...