I have that error"#1273 - Unknown collation: 'utf8mb4_0900_ai_ci'"

Viewed 7325
CREATE TABLE `payment_methods` (
  `payment_method_id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`payment_method_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
2 Answers

utf8mb4_0900_ai_ci is a collation that is new in MySQL 8.0

It is not recognized in earlier versions of MySQL, for example 5.7.

It may also not be recognized in forks of MySQL such as MariaDB.

You should only use that collation in MySQL 8.0.

Consult documentation for the version of software you are using to see the set of supported collations.

For example: https://dev.mysql.com/doc/refman/5.7/en/charset-charsets.html

Or query INFORMATION_SCHEMA.COLLATIONS to find the list.

Related