0

I want to upload database from localhost to server and I get 1067 error. Localhost Mysql version - 5.7 Server - MariaDB, v5.5.68

Code part

CREATE TABLE `wp_momopay_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `amount` int(10) unsigned DEFAULT '0',
  `phone_number` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `payment_id` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `failed_reason` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `salt` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `status` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Error message

ERROR 1067 (42000) at line 1721: Invalid default value for 'created'
program 'mysql' finished with non-zero exit code: 1

1 Answer 1

1

Mariadb 5.5 only allows TIMESTAMP, not DATETIME, columns to have the CURRENT_TIMESTAMP default value. So your table definition uses a feature it lacks.

Mariadb 5.5 hit end-of-life on 11-April-2020, well over two years ago.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.