2015-10-20 76 views
0
DROP TABLE IF EXISTS `{DB_TABLE_PREFIX}broadcast`; 
#[QUERY] 
CREATE TABLE `{DB_TABLE_PREFIX}broadcast` (
    `bid` mediumint(8) NOT NULL auto_increment, 
    `sortid` mediumint(8) NOT NULL default '0', 
    `content` varchar(255) NOT NULL default '', 
    `gourl` varchar(255) NOT NULL default '#', 
    PRIMARY KEY (`bid`) 
) TYPE=MyISAM {setCharset} AUTO_INCREMENT=1 ; 
#[QUERY] 
DROP TABLE IF EXISTS `{DB_TABLE_PREFIX}items`; 
#[QUERY] 
CREATE TABLE `{DB_TABLE_PREFIX}items` (
    `itemid` mediumint(8) unsigned NOT NULL auto_increment, 
    `uid` mediumint(8) unsigned NOT NULL default '0', 
    `account` varchar(15) NOT NULL default '', 
    `content` varchar(255) NOT NULL default '', 
    `dateline` int(10) unsigned NOT NULL default '0', 
    `digg` mediumint(8) unsigned NOT NULL default '0', 
    `reply` mediumint(5) unsigned NOT NULL default '0', 
    PRIMARY KEY (`itemid`), 
    KEY `uid` (`uid`) 
) TYPE=MyISAM {setCharset} AUTO_INCREMENT=1 ; 
#[QUERY] 
DROP TABLE IF EXISTS `{DB_TABLE_PREFIX}reply`; 
#[QUERY] 
CREATE TABLE `{DB_TABLE_PREFIX}reply` (
    `rid` mediumint(8) NOT NULL auto_increment, 
    `replyto` mediumint(8) unsigned NOT NULL default '0', 
    `uid` mediumint(8) NOT NULL default '0', 
    `account` varchar(15) NOT NULL default '', 
    `content` varchar(255) NOT NULL default '', 
    `dateline` int(10) unsigned NOT NULL default '0', 
    PRIMARY KEY (`rid`), 
    KEY `uid` (`uid`), 
    KEY `replyto` (`replyto`) 
) TYPE=MyISAM {setCharset} AUTO_INCREMENT=1 ; 
#[QUERY] 
DROP TABLE IF EXISTS `{DB_TABLE_PREFIX}setting`; 
#[QUERY] 
CREATE TABLE `{DB_TABLE_PREFIX}setting` (
    `setname` varchar(255) NOT NULL default '', 
    `data` text NOT NULL, 
    PRIMARY KEY (`setname`) 
) TYPE=MyISAM {setCharset} ; 

我嘗試導入該MySQL數據庫,並收到此錯誤SQL {} setCharset AUTO_INCREMENT =第1' 行1

您的SQL語法錯誤;檢查手冊中 對應於你的MySQL服務器版本正確的語法使用 附近「{} setCharset AUTO_INCREMENT = 1」在行1

難道我錯過了什麼?請幫助我!

+0

MySQL和/或MS SQL Server?不要標記不涉及的產品。 – jarlh

回答

0

更換

TYPE=MyISAM 

通過

ENGINE=MYISAM 

試試這個,我已經使用表前綴爲"t_"

DROP TABLE IF EXISTS `t_broadcast`; 
CREATE TABLE `t_broadcast` (
    `bid` MEDIUMINT(8) NOT NULL AUTO_INCREMENT, 
    `sortid` MEDIUMINT(8) NOT NULL DEFAULT '0', 
    `content` VARCHAR(255) NOT NULL DEFAULT '', 
    `gourl` VARCHAR(255) NOT NULL DEFAULT '#', 
    PRIMARY KEY (`bid`) 
) ENGINE=MYISAM; 

DROP TABLE IF EXISTS `t_items`; 
CREATE TABLE `t_items` (
    `itemid` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT, 
    `uid` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', 
    `account` VARCHAR(15) NOT NULL DEFAULT '', 
    `content` VARCHAR(255) NOT NULL DEFAULT '', 
    `dateline` INT(10) UNSIGNED NOT NULL DEFAULT '0', 
    `digg` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', 
    `reply` MEDIUMINT(5) UNSIGNED NOT NULL DEFAULT '0', 
    PRIMARY KEY (`itemid`), 
    KEY `uid` (`uid`) 
) ENGINE=MYISAM; 

DROP TABLE IF EXISTS `t_reply`; 
CREATE TABLE `t_reply` (
    `rid` MEDIUMINT(8) NOT NULL AUTO_INCREMENT, 
    `replyto` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', 
    `uid` MEDIUMINT(8) NOT NULL DEFAULT '0', 
    `account` VARCHAR(15) NOT NULL DEFAULT '', 
    `content` VARCHAR(255) NOT NULL DEFAULT '', 
    `dateline` INT(10) UNSIGNED NOT NULL DEFAULT '0', 
    PRIMARY KEY (`rid`), 
    KEY `uid` (`uid`), 
    KEY `replyto` (`replyto`) 
) ENGINE=MYISAM; 

DROP TABLE IF EXISTS `t_setting`; 
CREATE TABLE `t_setting` (
    `setname` VARCHAR(255) NOT NULL DEFAULT '', 
    `data` TEXT NOT NULL, 
    PRIMARY KEY (`setname`) 
) ENGINE=MYISAM ; 
+0

它仍然給我同樣的錯誤... – yoona1314

+0

@EdmundYau - 你爲{setCharset}設置了什麼值 – PravinS

+0

我不知道那是什麼... – yoona1314

0

試試這個:

CREATE TABLE `broadcast` (
    `bid` mediumint(8) NOT NULL auto_increment, 
    `sortid` mediumint(8) NOT NULL default '0', 
    `content` varchar(255) NOT NULL default '', 
    `gourl` varchar(255) NOT NULL default '#', 
    PRIMARY KEY (`bid`) 
) TYPE=MyISAM AUTO_INCREMENT=50 ; 

大括號僅用於解釋您從其他來源的語法中引用的內容。

相關問題