Search code examples
mysqlsqlwordpressphpmyadminmysql-error-1064

error upload .sql file of wordpress site


this is the error

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ical subscribe access key,

created_on datetime DEFAULT NULL, `updated' at line 20

Erreur requête SQL:

-- --------------------------------------------------------
--
-- Structure de la table `pec_calendars`
--
CREATE TABLE  `pec_calendars` (

 `id` INT( 11 ) UNSIGNED NOT NULL ,
 `type` ENUM(  'user',  'group',  'url' ) DEFAULT  'user',
 `user_id` INT( 11 ) UNSIGNED DEFAULT NULL ,
 `name` VARCHAR( 100 ) DEFAULT NULL ,
 `description` TEXT,
 `color` VARCHAR( 7 ) DEFAULT NULL ,
 `admin_id` INT( 11 ) DEFAULT NULL ,
 `status` ENUM(  'on',  'off' ) DEFAULT  'on',
 `show_in_list` ENUM(  '0',  '1' ) DEFAULT NULL ,
 `public` TINYINT( 3 ) UNSIGNED DEFAULT  '0',
 `reminder_message_email` TEXT,
 `reminder_message_popup` TEXT,
 `access_key` VARCHAR( 32 ) DEFAULT NULL COMMENT AS  `ical subscribe access key` ,
 `created_on` DATETIME DEFAULT NULL ,
 `updated_on` DATETIME DEFAULT NULL
) ENGINE = INNODB DEFAULT CHARSET = utf8; 

Solution

  • Guess your query should be:

    CREATE TABLE pec_calendars 
      ( 
         id                     INT(11) UNSIGNED NOT NULL, 
         type                   ENUM('user', 'group', 'url') DEFAULT 'user', 
         user_id                INT(11) UNSIGNED DEFAULT NULL, 
         name                   VARCHAR(100) DEFAULT NULL, 
         description            TEXT, 
         color                  VARCHAR(7) DEFAULT NULL, 
         admin_id               INT(11) DEFAULT NULL, 
         status                 ENUM('on', 'off') DEFAULT 'on', 
         show_in_list           ENUM('0', '1') DEFAULT NULL, 
         public                 TINYINT(3) UNSIGNED DEFAULT '0', 
         reminder_message_email TEXT, 
         reminder_message_popup TEXT, 
         access_key             VARCHAR(32) DEFAULT NULL, 
         created_on             DATETIME DEFAULT NULL, 
         updated_on             DATETIME DEFAULT NULL 
      ) 
    engine = innodb 
    DEFAULT charset = utf8;