Linked Questions

0 votes
1 answer
913 views

Laravel migration errors [duplicate]

Created new Laravel 5.2.8 project. When I want do predefined migration, I get an errors: [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there ...
Alexander Abumov's user avatar
134 votes
12 answers
187k views

Having both a Created and Last Updated timestamp columns in MySQL 4.0

I have the following table schema; CREATE TABLE `db1`.`sms_queue` ( `Id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `Message` VARCHAR(160) NOT NULL DEFAULT 'Unknown Message Error', `CurrentState`...
Xenph Yan's user avatar
  • 83.6k
47 votes
3 answers
125k views

MySQL CURRENT_TIMESTAMP as DEFAULT

While creating a table I am getting the following error: ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause ...
Bart Platak's user avatar
  • 4,425
10 votes
3 answers
13k views

MariaDB/MySql: Setting CURRENT_TIMESTAMP on CREATE and changing noting on UPDATE

I have not used MySQL in a few years and when I created a new table it did something I was not expecting. I am using MariaDB v5.5.60-MariaDB I need to create a table that has both a created column ...
Intervalia's user avatar
  • 10.7k
5 votes
1 answer
17k views

What is the reason for Mysql error code 1293

Here is the message of mysql error 1293: SQL Error (1293): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause what is the ...
solomon_wzs's user avatar
  • 1,711
2 votes
2 answers
3k views

Error in setting the default value to CURRENT_TIMESTAMP [duplicate]

I am having problem while altering a table. I need a column with data type DATETIME to take default value as current date/time and on update also it should automatically update it's value to current ...
Imdad's user avatar
  • 5,962
0 votes
3 answers
3k views

Unable to create 2 timestamp columns in 1 MySQL table

My sql query looks like this ALTER TABLE `exercises` ADD COLUMN `creation_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `lesson_id`, ADD COLUMN `modification_dt` timestamp NULL DEFAULT '' ...
heron's user avatar
  • 3,633
1 vote
3 answers
2k views

MySQL: CURRENT_TIMESTAMP for date field works locally but not on server

I have a date column whose default value is CURRENT_TIMESTAMP. It works fine locally, but when I did an export and tried to create the database on my hosting I get this: `Invalid default value for '...
Mitya's user avatar
  • 34.1k
2 votes
1 answer
2k views

Trigger for inserting/updating current date running into error MySQL

I'd like to create an update/insert trigger for the current date (to save a timestamp when it got modified last). So, since I read that you cannot define an update/insert trigger, but I need to define ...
Rüdiger's user avatar
  • 923
2 votes
0 answers
819 views

I can't insert proper timestamp to mysql database and I don't know why

I have a table in my database that contains three fields: id | start_time | modification_time When I look at it in phpmyadmin, I see that: id is primary key, auto increment, int start_time has ...
randomuser2's user avatar
1 vote
1 answer
518 views

MySQL: #1293 - Incorrect table definition

Designed Database and Table in Local Server Using MySQL 5.6.17 and Export into *.sql file. When try to Import *.sql file into Live Server(MySQL 5.1.36) got below Error: #1293 - Incorrect table ...
Syed Nizamudeen's user avatar
0 votes
1 answer
263 views

Synchronizing between DATETIME and TIMESTAMP

As clearly indicated by Should I use field 'datetime' or 'timestamp'?, the major differences between a DATETIME and TIMESTAMP field are: TIMESTAMP in MySQL are generally used to track ...
user1032531's user avatar
  • 25.7k
0 votes
0 answers
269 views

MySQL's on update now() working for one table and not for another when updated by Hibernate

I can't make MySQL to update a TIMESTAMP field marked as CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP when the update query is made by Hibernate. According to this answer, and this comment, MySQL ...
user384729's user avatar
1 vote
1 answer
232 views

How to insert two datetime fields with same server time in mysql?

I have a table with two fields insert_time and update_time. The type of insert_time is varchar(30) NOT NULL DEFAULT '' while the type of update_time is timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON ...
Aflext's user avatar
  • 309
0 votes
1 answer
231 views

timestamp error in mysql while installing magento

i am having an error in mysql while installing magento in server` currently mysql version is 5.5 a:5:{i:0;s:295:"Error in file: "/home/jobixcoindia/public_html/app/code/local/Ced/CsMarketplace/...
kamilus's user avatar
  • 29

15 30 50 per page