I'm not a PHP programmer but I'll try to explain my problem.
I've create table in my php database:
DROP TABLE IF EXISTS visual_verify_code;
CREATE TABLE visual_verify_code (
oscsid varchar(32) NOT NULL,
code varchar(6) NOT NULL,
dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),
PRIMARY KEY (oscsid)
);
It worked OK, after few days I backup my database and try to restore it, but it keeps
complaining on the "dt":
ERROR 1067 (42000) at line 38009: Invalid default value for 'dt'
so the database is dropped but never restored. The backup data base contain:
create table visual_verify_code (
oscsid varchar(32) not null ,
code varchar(6) not null ,
dt timestamp default 'CURRENT_TIMESTAMP' not null ,
PRIMARY KEY (oscsid)
);
so the difference is:
dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),
vs
dt timestamp default 'CURRENT_TIMESTAMP' not null ,
If I change in backup database the line to: "dt TIMESTAMP(12) NOT NULL DEFAULT
NOW(),"
I can restore it without problems.
Why is it doing it?
In "dt" table structure the "default" has option:
- None
- As Defined:
- NULL
- CURRENT_TIMESTAMP
If I change setting from "CURRENT_TIMESTAMP" to any of the above will it help restore it correctly?
--
Joseph