2012-03-17 110 views
1

#1064 - 您的SQL語法錯誤;檢查對應於你的MySQL服務器版本正確的語法使用 附近「TYPE = MyISAM的」在第8行「」手動導入數據庫時​​出現MySQL錯誤

# 
# Table structure for table 'members' 
# 

CREATE TABLE `members` (
`member_id` int(11) unsigned NOT NULL auto_increment, 
`firstname` varchar(100) default NULL, 
`lastname` varchar(100) default NULL, 
`login` varchar(100) NOT NULL default '', 
`passwd` varchar(32) NOT NULL default '', 
PRIMARY KEY (`member_id`) 
) TYPE=MyISAM; 



# 
# Dumping data for table 'members' 
# 

INSERT INTO `members` (`member_id`, `firstname`, `lastname`, `login`, `passwd`)     VALUES("1", "Jatinder", "Thind", "phpsense", "ba018360fc26e0cc2e929b8e071f052d"); 
+0

可能重複的[CREATE TABLE ... TYPE = MYISAM中的1064錯誤](http://stackoverflow.com/questions/12428755/1064-error-in-create-table-type-myisam) – Jocelyn 2013-04-09 09:15:36

回答

2

嘗試使用「引擎」,而不是「類型」:

CREATE TABLE `members` (
`member_id` int(11) unsigned NOT NULL auto_increment, 
`firstname` varchar(100) default NULL, 
`lastname` varchar(100) default NULL, 
`login` varchar(100) NOT NULL default '', 
`passwd` varchar(32) NOT NULL default '', 
    PRIMARY KEY (`member_id`) 
) ENGINE=MYISAM; 

欲瞭解更多信息,請查閱MySql Manual

據我所知'TYPE'已被棄用。

1

TYPE選項在MySQL 4棄用,在MySQL 5.5去除,所以你可能想:

CREATE TABLE `members` (
    `member_id` int(11) unsigned NOT NULL auto_increment, 
    `firstname` varchar(100) default NULL, 
    `lastname` varchar(100) default NULL, 
    `login` varchar(100) NOT NULL default '', 
    `passwd` varchar(32) NOT NULL default '', 
     PRIMARY KEY (`member_id`) 
) ENGINE=MyISAM; 

有關詳細信息,請參閱MySQL CREATE TABLE documentation