mysql default value error

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

mysql default value error

Post by 829computers » Mon Sep 17, 2007 1:05 am

I just realized this may not get looked at, since it appears to have been closed, http://www.phpbb.com/bugs/phpbb3/ticket ... 1&start=10


Field 'forum_last_post_subject' doesn't have a default value [1364]. For me, this happens on all posts and PM's.

I moved my phpBB3 RC5 forum that was running on mysql 4 to a new host running mysql 5 and now I get the default value error. I ran the mysql updater tool got the output, that is where I am stuck. Is there another way to do this? I am not getting any help from my host.


Thanks.

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 5:28 am

A quick bump before bed.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 5:36 am

The issue you have is you have moved from a mysql 4.0 database server to a mysql 5 server, mysql4 and mysq5 are different are very different, you can not just restore backups from a mysql4 server into a mysql5 server without issues, and the problem you are getting is one of those issues, luckily for you the developers have been keen to make a fix for this issue.

Knowledge Base - Doesn't have a default value errors
Last edited by karlsemple on Fri Feb 22, 2008 9:59 am, edited 1 time in total.
Reason: Removed outdated download!
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 5:45 am

I did that, I will give a sample, but I do not understand where the "not null" start and end and what exactlly to to put in the command box.

I had no choice on the move, I had ipowerweb and could not stand it any longer.

Thanks for the reply.

Code: Select all

USE mytechdirect_forum; # Table: 'phpbb_attachments' ALTER TABLE phpbb_attachments MODIFY attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, MODIFY post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, MODIFY topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, MODIFY in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, MODIFY poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, MODIFY is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, MODIFY physical_filename varchar(255) DEFAULT '' NOT NULL COLLATE utf8_bin, MODIFY real_filename varchar(255) DEFAULT '' NOT NULL COLLATE utf8_bin, MODIFY download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, MODIFY attach_comment text NOT NULL COLLATE utf8_bin, MODIFY extension varchar(100) DEFAULT '' NOT NULL COLLATE utf8_bin, MODIFY mimetype varchar(100)
Last edited by 829computers on Mon Sep 17, 2007 5:53 am, edited 1 time in total.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 5:49 am

Was that all it gave you?
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 5:50 am

Here is a full report, if it helps, but you have probably seen it before on others.

http://mytechdirect.net/forum/mysql_upgrader.php

No mods, straight install.


I did not want to put the whole list in to clutter up the topic, so others could navigate the thread more easily.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 5:53 am

829computers wrote:Here is a full report, if it helps, but you have probably seen it before on others.

http://mytechdirect.net/forum/mysql_upgrader.php

No mods, straight install.


I did not want to put the whole list in to clutter up the topic, so others could navigate the thread more easily.

Did you actually download the file I uploaded into this topic as it stated it has not been downloaded yet? Or are you using another version you got from somewhere else?
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 5:54 am

I am using the version from the bug tracker. I will run the one you provided and run again.

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 6:01 am

Ok, I used the one you listed and it is a lot nicer looking. Do I take this line by line or do I put in chunks at a time?

Again using a truncated list,

USE mytechdirect_forum;

# Table: 'phpbb_attachments'
ALTER TABLE phpbb_attachments
MODIFY attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
MODIFY post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
MODIFY physical_filename varchar(255) DEFAULT '' NOT NULL COLLATE utf8_bin,
MODIFY real_filename varchar(255) DEFAULT '' NOT NULL COLLATE utf8_bin,
MODIFY download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY attach_comment text NOT NULL COLLATE utf8_bin,
MODIFY extension varchar(100) DEFAULT '' NOT NULL COLLATE utf8_bin,
MODIFY mimetype varchar(100) DEFAULT '' NOT NULL COLLATE utf8_bin,
MODIFY filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
MODIFY thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 6:03 am

How are you planning on executing this query? You should be able to execute the whole lot in one go especially if using something such as phpmyadmin.


FYI, this script was not originally meant to be run in a browser hence the garbled output of the original, DavidMJ has since fixed the output when used in a browse that why my upload worked ;)
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 6:05 am

Thank you.

I am using virtualmin and the sql command program that is built in.

I thought in the bug tracker post, he said not to use phpmyadmin?

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 6:08 am

829computers wrote:Thank you.

I am using virtualmin and the sql command program that is built in.

I thought in the bug tracker post, he said not to use phpmyadmin?

Well that is just outputted sql commands which I would have thought would run in phpmyadmin but if DavidMj said to use the console then best use the console :)
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 6:27 am

Well, I can edit posts, but cannot make new posts or private messages.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: mysql default value error

Post by karlsemple » Mon Sep 17, 2007 6:29 am

829computers wrote:Well, I can edit posts, but cannot make new posts or private messages.

why can you not make new posts or private messages...are you getting the same error? did you run all the queries? did you use phpmyadmin or the command line (I just tried phpmyadmin locally seemed to work ok although no promises)


Hop you are backing up before making changes
Image

829computers
Registered User
Posts: 101
Joined: Mon Sep 22, 2003 11:12 pm
Contact:

Re: mysql default value error

Post by 829computers » Mon Sep 17, 2007 6:33 am

Yes, same general error.

Ran all the queries via console, I will see if I have access to phpmyadmin to test.

General Error
SQL ERROR [ mysql4 ]

Field 'post_edit_reason' doesn't have a default value [1364]

SQL

INSERT INTO phpbb_posts (forum_id, poster_id, icon_id, poster_ip, post_time, post_approved, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_locked, topic_id) VALUES (2, 2, 0, '192.168.1.1', 1190010679, 1, 1, 1, 1, 1, '', 'Re: MyTechDirect NFL Football Pick \'em Season 2', 'TYest', '9879acbfeacb7c52e98e51d0dd40fda4', 0, '', 'fe3aa', 1, 0, 1026)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()

FILE: includes/functions_posting.php
LINE: 1813
CALL: dbal_mysql->sql_query()

FILE: posting.php
LINE: 996
CALL: submit_post()

Locked

Return to “[3.0.x] Support Forum”