【发布时间】:2018-03-29 10:26:08
【问题描述】:
我真的很难将 .sql 文件上传到 phpmyadmin。
我得到的错误是这样的......
SQL 查询:
CREATE TABLE `coupons` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
`active_from` datetime DEFAULT '2018-03-23 12:15:55',
`active_to` datetime DEFAULT '2018-03-30 12:15:55',
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `coupons_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
MySQL 说:
#1071 - 指定的密钥太长;最大密钥长度为 767 字节
这是我认为它所指的原始部分。
-- Table structure for table `coupons`
--
DROP TABLE IF EXISTS `coupons`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupons` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`percentage` decimal(5,2) NOT NULL DEFAULT '0.00',
`active_from` datetime DEFAULT '2018-03-23 12:15:55',
`active_to` datetime DEFAULT '2018-03-30 12:15:55',
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `coupons_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `coupons`
【问题讨论】:
标签: mysql