4
I had a problem trying to run my database script on the server. The error already gives in the first table that the script generates:
CREATE TABLE IF NOT EXISTS `categoria` (
`cd_categoria` int(255) NOT NULL,
`titulo` varchar(100) NOT NULL,
`cd_status` int(1) NOT NULL,
`dh_timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`dh_alteracao` datetime NOT NULL
) ;
The mistake that happens is this:
Error Code: 1067. Invalid default value for 'dh_timestamp'
I don’t understand what happened because I need my script to store in the column dh_timestamp the current date that if there is a record of anything. How can I resolve this?
What is the mysql version?
– Sergio
Sérgio, this script was generated on my machine, with mysql in version 5.6.21, and now I have to go up to a windows server with mysql in version 5.1.73. Unfortunately, I have to do in this version that is inferior to previous :(
– DiChrist