lorry
lorry

Reputation: 5

MySQL import Database error time datatype error

I exported the database, disabling foreign key checks (as advised by the webhost) and then imported it from the cPanel phpMyadmin.

It threw up the error below

Error SQL query:

-- --------------------------------------------------------
--
-- Table structure for table `club_listing`
--
CREATE TABLE IF NOT EXISTS  `club_listing` (

 `id` INT( 11 ) NOT NULL ,
 `name` VARCHAR( 50 ) NOT NULL ,
 `venue` VARCHAR( 100 ) NOT NULL ,
 `time` TIME( 4 ) NOT NULL ,
 `description1` VARCHAR( 15 ) NOT NULL ,
 `description2` VARCHAR( 15 ) NOT NULL ,
 `description3` VARCHAR( 15 ) NOT NULL ,
 `memberid` INT( 11 ) NOT NULL COMMENT  'foreignkey for members id for management',
 `photoid` INT( 11 ) NOT NULL COMMENT  'link to photo table',
 `imagefile` VARCHAR( 200 ) NOT NULL
) ENGINE = INNODB DEFAULT CHARSET = latin1;

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use 
near '(4) NOT NULL,
description1 varchar(15) NOT NULL,
description2 varchar(15' at line 11 

I zeroed the error to be the time datatype. However, I checked the mysql documentation and couldn't find anything that explains the error.

the webhost mysql is version 5.5 while xampp is 5.6

Upvotes: 0

Views: 214

Answers (1)

snowsprinkle
snowsprinkle

Reputation: 36

If you create it without the length it will compile, I would suggest that if you can get away with it, then just truncate the time to the correct precision in your sql calls. I was having the same error in phpmyadmin perhaps try it in command line.

Upvotes: 1

Related Questions