Good morning,
I’m trying to import a db and I’m getting this error message.
Can you help me?
I assume you’re using mysql, as this appears to be phpMyAdmin.
If you’re using mysql >= 8.0.13 (SELECT VERSION()
), you can specify a default value for the date as
`date` DATE NOT NULL DEFAULT (CURRENT_TIMESTAMP)
before that, a DATE
column cannot have a default value. (A TIMESTAMP
column can, but a DATE
cannot)
Thank you, how to change the date value because it is a .sql file? which I have from an online tutorial
an SQL file is just a plaintext file. Open it in notepad and edit it.
please use CURRENT_DATE instead!!
Is there a mechanical difference, or is it just to alleviate the DB doing a truncation? (Not to say that that isnt a valid reason to use it, mind, just curious)
clarity of intent
to OP: i would also use a better column name than `date`