Menu

MySQL DB Text Column Can't Have Default Value

Help
2009-03-09
2013-04-16
  • Michael Maddox

    Michael Maddox - 2009-03-09

    I am attempting to install phpBugTracker with MySQL 5.0.37. One of the queries that tries to initialize the database failed because it supplies a default value for a text field; that is forbidden:

    CREATE TABLE phpbt_auth_user (
        user_id int(10) unsigned NOT NULL default '0',
        login char(40) NOT NULL default '',
        first_name char(40) NOT NULL default '',
        last_name char(40) NOT NULL default '',
        email char(60) NOT NULL default '',
        password char(40) NOT NULL default '',
        active tinyint(3) unsigned NOT NULL default '1',
        bug_list_fields text NOT NULL default '',                    <---!!
        created_by int(10) unsigned NOT NULL default '0',
        created_date bigint(20) unsigned NOT NULL default '0',
        last_modified_by int(10) unsigned NOT NULL default '0',
        last_modified_date bigint(20) unsigned NOT NULL default '0',
        PRIMARY KEY (user_id),
        UNIQUE KEY login (login)) TYPE=MyISAM; [nativecode=1101
    ** BLOB/TEXT column 'bug_list_fields' can't have a default value]

    I took the default value off the bug_list_fields table and the query ran. But the next query on that table assumed there was a default value:

    INSERT INTO phpbt_auth_user (user_id, login, first_name, last_name, email, password, active) values (0, 'Anonymous User', 'Anonymous', 'User', '', '', 0)

    MySQL then complained that the bugs_list_field DIDN'T have a default value.

    How should I fix this problem?

    Thanks!

    jqphantom

     
    • Michael Maddox

      Michael Maddox - 2009-03-09

      I see this error has been discussed, although not resolved.

      I hit another error, but I will open a new thread for it, to make it easier to spot.

      jqphantom

       
    • Nobody/Anonymous

      You run MySQL in strict mode. Running it in non strict mode fixed that problem for me.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.