mysql创建数据表报错#1064,求解答
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql创建数据表报错#1064,求解答相关的知识,希望对你有一定的参考价值。
CREATETABLE`dede_payment`(
`id`tinyint(3)unsignedNOTNULLAUTO_INCREMENT,
`code`varchar(20)NOTNULLDEFAULT'',
`name`varchar(120)NOTNULLDEFAULT'',
`fee`varchar(10)NOTNULLDEFAULT'0',
`description`textNOTNULL,
`rank`tinyint(3)unsignedNOTNULLDEFAULT'0',
`config`textNOTNULL,
`enabled`tinyint(1)unsignedNOTNULLDEFAULT'0',
`cod`tinyint(1)unsignedNOTNULLDEFAULT'0',
`online`tinyint(1)unsignedNOTNULLDEFAULT'0',
PRIMARYKEY(`id`),
UNIQUEKEY`code`(`code`)USINGBTREE)ENGINE=MYISAMAUTO_INCREMENT=7DEFAULTCHARSET=utf8;
我去掉UNIQUE KEY `code`(`code`) USING
BTREE就不会报错,不过因为我是从以个mysql里导出的数据,现在要放入另一个mysql里,怎么就会报错呢?首先编码都一致,也插入了大概1/3
的表,为嘛就会出这问题呢?
这是错误提示:
#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 'USING BTREE) ENGINE=MyISAM AUTO_INCREMENT=7DEFAULT CHARSET=utf8' at line 13
`id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(20) NOT NULL DEFAULT'',
`name` varchar(120) NOT NULL DEFAULT'',
`fee` varchar(10) NOT NULL DEFAULT'0',
`description` text NOT NULL,
`rank` tinyint(3) unsigned NOT NULL DEFAULT'0',
`config` text NOT NULL,
`enabled` tinyint(1) unsigned NOT NULL DEFAULT'0',
`cod` tinyint(1) unsigned NOT NULL DEFAULT'0',
`online` tinyint(1) unsigned NOT NULL DEFAULT'0',
PRIMARY KEY(`id`),
UNIQUE KEY `code`(`code`) USING BTREE
)ENGINE=MYISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
这位兄台,麻烦下次贴代码格式好点吧。 参考技术A 遇到同样的问题。
hibernate4.2.2使用schemaExport生成数据表报错,junit提示:SQLNestedException: Cannot create PoolableConnectionFact
给mysql的root授权远程连接
1 mysql -u root –p 2 mysql>use mysql; 3 mysql>update user set host = ‘%‘ where user = ‘root‘; 4 mysql>select host, user from user;
hibernate.cfg.xml的内容
1 <property name="connection.username">root</property> 2 <property name="connection.password">0318</property>
junit的测试内容
1 ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure().build(); 2 3 MetadataImplementor metadataImplementor = (MetadataImplementor) 4 new MetadataSources(serviceRegistry).buildMetadata(); 5 6 SchemaExport export = new SchemaExport(serviceRegistry, metadataImplementor); 7 export.create(true, true);
以上是关于mysql创建数据表报错#1064,求解答的主要内容,如果未能解决你的问题,请参考以下文章
关于python使用django创建mysql表报错问题的解决
mysql创建表报错:ERROR 1118 (42000) ...Row size too large (> 8126)
mysql创建表报错:ERROR 1118 (42000) ...Row size too large (> 8126)
hibernate4.2.2使用schemaExport生成数据表报错,junit提示:SQLNestedException: Cannot create PoolableConnectionFact