• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

#1067 - Invalid default value for 'created_date'

imabotmail

Well-known member
Trusted Uploader
Jan 17, 2020
361
342
63
I'm trying to run the following query into mysql via phpmyadmin and I keep getting this error and I don't know know how to solve it.

Spoiler

I've tried to everything listed here: Google Search and nothing works. What am I doing wrong? Any mysql expert here, please help.
 
I'm trying to run the following query into mysql via phpmyadmin and I keep getting this error and I don't know know how to solve it.

Spoiler

I've tried to everything listed here: Google Search and nothing works. What am I doing wrong? Any mysql expert here, please help.

If you replace the following two lines, it should work.

`created_date` datetime DEFAULT NOT NULL CURRENT_TIMESTAMP,
`updated_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

or

`created_date` datetime DEFAULT NOT NULL CURRENT_TIMESTAMP,
`updated_date` datetime DEFAULT NOW()
 
I get this:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL CURRENT_TIMESTAMP,
`updated_date` datetime DEFAULT CURRENT_TIMESTAMP' at line 17
 
I get this:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL CURRENT_TIMESTAMP,
`updated_date` datetime DEFAULT CURRENT_TIMESTAMP' at line 17

`created_date` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NUll,
`updated_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

or

`created_date` datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
`updated_date` datetime DEFAULT NOW()

Sorry, I guess I need a coffee.. ;)
 
Last edited:
😂 I hear you. Brewing a fresh pot as we speak. LOL Sorry, neither one work. :(
A little insight, I'm running Plesk CP with mysql 5.5.68-MariaDB and can't upgrade either.
 
😂 I hear you. Brewing a fresh pot as we speak. LOL Sorry, neither one work. :(
A little insight, I'm running Plesk CP with mysql 5.5.68-MariaDB and can't upgrade either.
Oh dear... this is an old version of mysql, it is not implemented there yet.

Try the following:
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_date` timestamp NOT NULL DEFAULT ' 0000-00-00 00:00:00 '
 
Nope, but different error: #1005 - Can't create table 'scmdb.online_courses' (errno: 150)
 
Nope, but different error: #1005 - Can't create table 'scmdb.online_courses' (errno: 150)
It could be the "Foreign Key"... Add it before and after your query.

SET FOREIGN_KEY_CHECKS = 0;
CREATE TABLE `online_courses` (
...
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_date` timestamp NOT NULL DEFAULT NOW()
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;

If that doesn't work, I'm afraid I'm out. :)
 
  • Like
Reactions: TassieNZ
Thank you my friend @jackdanielz - I too, I'm giving up. Sadly this gives the following error. Thanks for all your help.

#1005 - Can't create table 'scmdb.online_courses' (errno: 150)
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock