2016-04-27 86 views
-1

我有以下錯誤,而在管線53上載數據庫上傳數據庫錯誤

錯誤:)ENGINE = MyISAM的默認字符集= LATIN1 AUTO_INCREMENT = 2;

查詢:

CREATE TABLE IF NOT EXISTS `wpcads_paypal` (
`main_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
`user_id` text NOT NULL, 
`transaction_id` text NOT NULL, 
`firstname` text NOT NULL, 
`lastname` text NOT NULL, 
`email` text NOT NULL, 
`description` text NOT NULL, 
`summary` text NOT NULL, 
`created` int(4) unsigned NOT NULL, 
PRIMARY KEY (`main_id`) 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 

的MySQL:

您的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以找到在「-------------------------------- ------------------------ - - CREATE TABLE IF N」在管路4

停止在錯誤

+0

嘗試刪除連字符創建您的查詢之前。 – WannaBeGeek

回答

0

已爲相同的查詢創建了一個表您已經提到 這很好(您的查詢沒有任何問題)

您在查詢中出現的多餘字符必定是問題,現在只需複製查詢並嘗試創建表格

mysql> CREATE TABLE IF NOT EXISTS wpcads_paypal ( main_id bigint(20) 
unsigned NOT NULL AUTO_INCREMENT, user_id text NOT NULL, transaction_id text NOT NULL, firstname text NOT NULL, 
lastname text NOT NULL, email text NOT NULL, description text NOT NULL, summary text NOT NULL, created int(4) 
unsigned NOT NULL, PRIMARY KEY (main_id)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2; 
Query OK, 0 rows affected (0.06 sec) 

mysql> desc wpcads_paypal; 
+----------------+---------------------+------+-----+---------+----------------+ 
| Field   | Type    | Null | Key | Default | Extra   | 
+----------------+---------------------+------+-----+---------+----------------+ 
| main_id  | bigint(20) unsigned | NO | PRI | NULL | auto_increment | 
| user_id  | text    | NO |  | NULL |    | 
| transaction_id | text    | NO |  | NULL |    | 
| firstname  | text    | NO |  | NULL |    | 
| lastname  | text    | NO |  | NULL |    | 
| email   | text    | NO |  | NULL |    | 
| description | text    | NO |  | NULL |    | 
| summary  | text    | NO |  | NULL |    | 
| created  | int(4) unsigned  | NO |  | NULL |    | 
+----------------+---------------------+------+-----+---------+----------------+ 
9 rows in set (0.01 sec) 
1

我已經試過這個代碼表中創建的成功充分:

CREATE TABLE IF NOT EXISTS wpcads_paypal( main_id BIGINT(20)UNSIGNED NOT NULL AUTO_INCREMENT, USER_ID TEXT NOT NULL, TRANSACTION_ID TEXT NOT NULL, 名字TEXT NOT NULL, 姓氏TEXT NOT NULL, 電子郵件TEXT NOT NULL, 描述TEXT NOT NULL, 摘要TEXT NOT NULL, 創建INT(4)UNSIGNED NOT NULL, PRIMARY KEY(main_id)

1

沒有在這個代碼中發現任何錯誤:

CREATE TABLE IF NOT EXISTS wpcads_paypal(main_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT , user_id TEXT NOT NULL , transaction_id TEXT NOT NULL , firstname TEXT NOT NULL , lastname TEXT NOT NULL , email TEXT NOT NULL , description TEXT NOT NULL , summary TEXT NOT NULL , created INT(4) UNSIGNED NOT NULL , PRIMARY KEY (main_id)