Only one TIMESTAMP field can default to "now" I must say first of all, if you are trying to define multiple MySQL fields TIMESTAMP using CURRENT_TIMESTAMP or "default now", unfortunately this is bad, you cannot do it in MySQL I just got this MySQL TIMESTAMP error when trying to create a table as follows:
create table users ( id int unsigned auto_increment not null primary key, username varchar(50) not null unique, password varchar(40) not null, email_address varchar(128) not null unique, email_sent timestamp not null, last_login timestamp not null default now() ) ENGINE = InnoDB;
When I first solved this problem, I thought MySQL required the "CURRENT_TIMESTAMP (default now)" field to be declared before any other TIMESTAMP fields, so I solved my problem as follows:
create table users ( id int unsigned auto_increment not null primary key, username varchar(50) not null unique, password varchar(40) not null, email_address varchar(128) not null unique, last_login timestamp not null default now(), email_sent timestamp not null ) ENGINE = InnoDB;
source share