Invalid default value for 'LogTime'


#1

Hello all!

I’m a total noob when it comes to databases - so please bear with me :slight_smile:

So I managed to connect via the shell and was even able to start the process of database restoration using the following command:

mysql -u dbuser -p -h dbhost.yoursite.com dbname < /path/to/backup.sql

There is a massive problem though: when that it done, after a pause, I get the following message:

ERROR 1067 (42000) at line 5320: Invalid default value for ‘LogTime’

Here is the code that is found at line 5320 and those associated therewith:

[b]DROP TABLE IF EXISTS smf_log_online;

CREATE TABLE smf_log_online (
session varchar(32) NOT NULL default ‘’,
logTime timestamp default ‘CURRENT_TIMESTAMP’,
ID_MEMBER mediumint(8) unsigned NOT NULL default 0,
ip int(11) unsigned NOT NULL default 0,
url text NOT NULL default ‘’,
PRIMARY KEY (session),
KEY online (logTime, ID_MEMBER),
KEY ID_MEMBER (ID_MEMBER)
) TYPE=MyISAM;[/b]

Do I need to change anything there to get it to work?

Many thanks,
David


#2

Got it sorted!

It should say DEFAULT CURRENT_TIMESTAMP and not DEFAULT ‘CURRENT_TIMESTAMP’