Reputation: 3
okay so i have transferred my website % database over from an old computer which had now died and am trying to set it up on my own mac locally however I am running into a few issues. As of now i have setup xampp and phpmyadmin however when i try to import my .sql
database.
I am getting an error:
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 'TYPE=InnoDB AUTO_INCREMENT=3 AUTO_INCREMENT=3' at line 31
-- version 2.8.0.1
-- Host: custsql-ipg68.eigbox.net -- Generation Time: Aug 22, 2015 at 05:57 AM -- Server version: 5.5.44
blake
--
doctor
CREATE TABLE `doctor` (
`D_id` int(11) NOT NULL AUTO_INCREMENT,
`D_name` varchar(145) NOT NULL,
`D_SSn` varchar(145) NOT NULL,
`Age` varchar(145) NOT NULL,
`Phone` varchar(145) NOT NULL,
`Address` varchar(145) NOT NULL,
`city` varchar(145) NOT NULL,
`state` varchar(145) NOT NULL,
`zip` varchar(145) NOT NULL,
`office` varchar(145) NOT NULL,
PRIMARY KEY (`D_id`)
) TYPE=InnoDB AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
--
doctor
INSERT INTO `doctor` VALUES (1, 'David Jones', '123-64-2654', '48', '134-264-4567', '1234 st boulevard', 'Los Angeles', 'CA', '12345', '123456789');
--
patient
CREATE TABLE `patient` (
`P_id` int(11) NOT NULL AUTO_INCREMENT,
`P_Name` varchar(145) NOT NULL,
`P_SSn` varchar(145) NOT NULL,
`BirthDate` varchar(145) NOT NULL,
`Phone` varchar(145) NOT NULL,
`Address` varchar(145) NOT NULL,
`city` varchar(145) NOT NULL,
`state` varchar(145) NOT NULL,
`zipcode` varchar(145) NOT NULL,
`P_Lname` varchar(145) NOT NULL,
`Gender` varchar(85) NOT NULL,
`Email` varchar(145) NOT NULL,
PRIMARY KEY (`P_id`)
) TYPE=InnoDB AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
--
patient
INSERT INTO `patient` VALUES (1, 'Mark', '624-54-1326', 'March-16-1856', '4172696000', '3801 South National Avenue', 'Springfield', 'MO', '65807', 'Alan', 'Male', '[email protected]');
INSERT INTO `patient` VALUES (4, 'Blake', '00012', '01/09/2015', '093284203894', '66 evergreen street', 'sydey', 'qld', '4007', 'douglas', 'male', '[email protected]');
Upvotes: 0
Views: 2519
Reputation: 7662
To declare table type you should use ENGINE
instead of TYPE
. Type
is wrong syntax.
Change from
) TYPE=InnoDB AUTO_INCREMENT=3 AUTO_INCREMENT=3 ;
) TYPE=InnoDB AUTO_INCREMENT=5 AUTO_INCREMENT=5 ;
To
) ENGINE=InnoDB AUTO_INCREMENT=3 ;
) ENGINE=InnoDB AUTO_INCREMENT=5 ;
Upvotes: 2