Please read carefully. This is not a duplicate on the topic: #1071 - Specified key was too long; max key length is 767 bytes and How to fix 1709 - Index column size too large. The maximum column size is 767 bytes. in mysql in XAMPP
I already have an existing base. And I get this error. My question is how to correct it and I tried everything.
First I set in my database.php this code
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
After I set:
Schema::defaultStringLength(191);
Always i got error message:
Index column size too large. The maximum column size is 767 bytes.
The first time my import burst here:
CREATE TABLE `admins` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`password` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admins_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci
This is 5 tables in a row, I have 40 more. For that reason I can't change existing table.
The question, how to fix this? I use mariaDB and xampp. The difference between my question and those above is that I import an existing table and I can not change the data. I also work in Laravel