I'm really struggling with uploading a .sql file to phpmyadmin.
The error I get is this...
SQL query:
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 said:
#1071 - Specified key was too long; max key length is 767 bytes
Here is the original section in which I think it's referring to.
-- 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`