I tried to create a table in MariaDB, I wanted it to be VARCHAR(767) and PRIMARY KEY. I used this command but this is not what I want to.
CREATE TABLE main(username VARCHAR(767) NOT NULL);
This command is executed, but if I add PRIMARY KEY the error will be appeared.
CREATE TABLE main(username VARCHAR(767) NOT NULL PRIMARY KEY);
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes