Link to home
Create AccountLog in
Avatar of skij
skijFlag for Canada

asked on

MySQL: Problem Creating Table on Older Version

This table structure was created using MySQL 5.6.27  
CREATE TABLE `Contacts` (
  `ContactID` int(11) NOT NULL AUTO_INCREMENT,
  `FName` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `LName` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Company` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Email` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Phone` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Address1` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Address2` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `City` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `State` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Country` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Notes` mediumtext COLLATE utf8_unicode_ci,
  `Status` char(20) COLLATE utf8_unicode_ci DEFAULT 'newlead',
  `SampleDate` datetime(6) NOT NULL,
  `FollowupDate` datetime(6) DEFAULT NULL,
  `SalesRep` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `PostalCode` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Website` char(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Source` char(50) COLLATE utf8_unicode_ci DEFAULT 'corporatetrainingmaterials.com',
  `OrgType` char(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Email2` char(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `HTTP_REFERER` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
  `REMOTE_ADDR` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Interest` char(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `UserPassword` char(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `TimeZone` int(11) DEFAULT NULL,
  `Quote` varchar(50) COLLATE utf8_unicode_ci DEFAULT '0',
  `Footprints` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  KEY `Contacts_ContactID` (`ContactID`),
  KEY `Contacts_Email` (`Email`,`Email2`),
  KEY `<Name of Missing Index, sysname,>` (`Status`,`SalesRep`,`Country`,`ContactID`,`FName`,`LName`,`Company`,`Email`,`Phone`,`SampleDate`,`FollowupDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Open in new window

When I try to use that code to create a similar table on a server running MySQL 5.1.30 I get an error:
#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 '(6) NOT NULL, `FollowupDate` datetime(6) DEFAULT NULL, `SalesRep` char(50)' at line 15

Open in new window

Please help! Thanks.
ASKER CERTIFIED SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer