5
    CREATE TABLE `admin_user` (
      `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'User ID',
      `firstname` varchar(32) DEFAULT NULL COMMENT 'User First Name',
      `lastname` varchar(32) DEFAULT NULL COMMENT 'User Last Name',
      `email` varchar(128) DEFAULT NULL COMMENT 'User Email',
      `username` varchar(40) DEFAULT NULL COMMENT 'User Login',
      `password` varchar(255) NOT NULL COMMENT 'User Password',
      `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'User Created Time',


is here is the problem--->`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'User Modified Time',

      `logdate` timestamp NULL DEFAULT NULL COMMENT 'User Last Login Time',
      `lognum` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'User Login Number',
      `reload_acl_flag` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Reload ACL',
      `is_active` smallint(6) NOT NULL DEFAULT '1' COMMENT 'User Is Active',
      `extra` text COMMENT 'User Extra Data',
      `rp_token` text COMMENT 'Reset Password Link[...]

MySQL said: Documentation #1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

I am installing a new magneto2 theme while importing sql I got this error.

I am using sql version PHP Version 5.6.30 on a PLESK server

8

Change

`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'User Modified Time'

to

`modified` timestamp NOT NULL DEFAULT 0 COMMENT 'User Modified Time'

And while updating record, save modified value to current time programatically.

| improve this answer | |
  • SO it's a mistake in theme SQL ? or some Magento requirements that I am not following – inrsaurabh Apr 18 '17 at 7:55
  • No mistake. As per your MySQL version, only one column of type TIMESTAMP can have CURRENT_TIMESTAMP as default value. – Kishan Patadia Apr 18 '17 at 7:57
  • i had same issue then I found that I was running myql 5.5 so it was causing this issue. Because from mysql 5.6 it is allowing multiple timestamp update statements – Dhaval Solanki Jul 3 '18 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.