Title: Failed to create table.
Last modified: September 1, 2016

---

# Failed to create table.

 *  [richardhaynes](https://wordpress.org/support/users/richardhaynes/)
 * (@richardhaynes)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/failed-to-create-table-3/)
 * I get the Failed to create table error when trying to apply the following sql
   statement:
 * CREATE TABLE `wp_actionlist` (
    `task_id` int(11) NOT NULL AUTO_INCREMENT, `task_name`
   longtext NOT NULL, `urgency` int(11) NOT NULL DEFAULT 0, `importance` int(11)
   NOT NULL DEFAULT 0, `who` text NOT NULL DEFAULT ‘0’, `due` date NOT NULL DEFAULT‘
   0’, `created` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’ COMMENT ‘Created
   Datetime’, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
   COMMENT ‘Updated Datetime’, PRIMARY KEY(`task_id`) ) ENGINE=MyISAM DEFAULT CHARSET
   =utf8 COMMENT=’actionlist’ AUTO_INCREMENT=1;
 * [https://wordpress.org/plugins/custom-database-tables/](https://wordpress.org/plugins/custom-database-tables/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Raghwendra Narayan Ojha](https://wordpress.org/support/users/wdraghwendra/)
 * (@wdraghwendra)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/failed-to-create-table-3/#post-7475930)
 * In the SQL statement **who **and **due **doesn’t except DEFAULT ‘0’ please try
   this statement
 * CREATE TABLE wp_actionlist (
    task_id int(11) NOT NULL AUTO_INCREMENT, task_name
   longtext NOT NULL, urgency int(11) NOT NULL DEFAULT 0, importance int(11) NOT
   NULL DEFAULT 0, who text NOT NULL , due date NOT NULL , created datetime NOT 
   NULL DEFAULT ‘0000-00-00 00:00:00’ COMMENT ‘Created Datetime’, updated timestamp
   NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘Updated
   Datetime’, PRIMARY KEY(task_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=’
   actionlist’ AUTO_INCREMENT=1
 *  [MentorMike](https://wordpress.org/support/users/mentormike/)
 * (@mentormike)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/failed-to-create-table-3/#post-7476253)
 * Same problem with Failed to Create.
 * CREATE TABLE `wpxq_gratitude` (
    `Name` char(12) ASCII NOT NULL DEFAULT ‘NAME’
   COMMENT ‘Name of Member’, `Date` date BINARY NOT NULL DEFAULT ‘TODAY’ COMMENT‘
   Date You’re Grateful’, `Greatful` text NOT NULL COMMENT ‘greatful’, PRIMARY KEY(`
   Name`) , INDEX(`Date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=’Greatfulness’;
 *  Plugin Author [ka2](https://wordpress.org/support/users/ka2/)
 * (@ka2)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/failed-to-create-table-3/#post-7476254)
 * Thank you for your inquiry.
 * You have mistaken the “Date” column definition. In the column of date type cannot
   have a binary attribute and strings like “TODAY” as default value. You should
   modify the “Date” column definition as follows.
 * If “Date” is date type:
 *     ```
       Date date NOT NULL COMMENT 'Date You''re Grateful',
       ```
   
 * If “Date” is binary type:
 *     ```
       Date binary(n) NOT NULL DEFAULT 'TODAY' COMMENT 'Date You''re Grateful',
       ```
   
 * Note: the “n” of the `binary(n)` is any integer
 * Thank you,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Failed to create table.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-database-tables_e4e2e2.svg)
 * [Custom DataBase Tables](https://wordpress.org/plugins/custom-database-tables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-database-tables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-database-tables/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-database-tables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-database-tables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-database-tables/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [ka2](https://wordpress.org/support/users/ka2/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/failed-to-create-table-3/#post-7476254)
 * Status: not resolved