2016-04-27 59 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)