Menu

Error when creating tables with text columns with default values

Developers
2015-11-12
2015-11-13
  • John Carbone

    John Carbone - 2015-11-12

    I'm getting the following error when creating tables on CentOS Linux release 7.0.1406 and MySQL Server version: 5.6.27:

    ERROR 1101 (42000): BLOB/TEXT column 'comments' can't have a default value
    

    The offending lines have "NOT NULL DEFAULT", for example:

    `comments`            text         NOT NULL DEFAULT '' COMMENT 'comments from the lab',
    
     
  • Kevin Yeh

    Kevin Yeh - 2015-11-12

    Not specific to OpenEMR. TEXT columns cannot have a default value.

    https://dev.mysql.com/doc/refman/5.6/en/blob.html

    BLOB and TEXT columns cannot have DEFAULT values.

     
  • fsgl

    fsgl - 2015-11-13
     

Log in to post a comment.