I am trying to create database from Entity in Symfony 4. However the result is:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
I know this is because it is trying to use utf8mb4 charset and utf8mb4_unicode_ci collation. I've tried to replace my doctrine.yaml file to utf8 and utf8_unicode_ci as well as:
@ORM\Table(name="users", options={"collate"="utf8_unicode_ci", "charset"="utf8", "engine"="MyISAM"})
But it's still trying to use utf88mb4. How can I force it to use utf8?
Hi i get the same error : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
I fix it with change length to 191 like this : @ORM\Column(type="string", length=191, unique=true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With