Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

316
Views
#1067 - Valor predeterminado no válido para 'marca de tiempo'

Transferí un sitio web de WordPress desde un plan de alojamiento compartido usando Plesk a un servidor VPS con una versión más nueva de Plesk. Al intentar cargar la base de datos MYSQL, recibo el siguiente error:

Consulta SQL de error: Copiar

 CREATE TABLE `XZu2B8_wc_reserved_stock` ( `order_id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `stock_quantity` double NOT NULL DEFAULT 0, `timestamp` datetime NOT NULL DEFAULT current_timestamp(), `expires` datetime NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`order_id`,`product_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

MySQL dijo: Documentación

#1067 - Valor predeterminado no válido para 'marca de tiempo'

¿Alguien tiene alguna idea de cómo arreglar eso?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Esto se introdujo solo en mysql 5.6

Para mysql 5.5, necesita el siguiente disparador y debe eliminar los valores PREDETERMINADOS PRIMERO para crear la tabla:

 CREATE TABLE `XZu2B8_wc_reserved_stock` ( `order_id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `stock_quantity` double NOT NULL DEFAULT 0, `timestamp` datetime NOT NULL, `expires` datetime NOT NULL , PRIMARY KEY (`order_id`,`product_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

Luego crea el disparador

 DELIMITER $$ CREATE TRIGGER before_insert_XZu2B8_wc_reserved_stock BEFORE INSERT ON XZu2B8_wc_reserved_stock FOR EACH ROW BEGIN IF NEW.`timestamp` IS NULL THEN SET NEW.`timestamp`= NOW(); END IF; IF NEW.`expires` IS NULL THEN SET NEW.`expires`= NOW(); END IF; END$$ DELIMITER ;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!