Mysql table creation statement execution error 1273 - Unknown collation: 'utf8mb4_0900_ai_ci'

question

Mysql table creation statement execution error 1273 - Unknown collation: 'utf8mb4_0900_ai_ci'

detailed question

The author is executing the sql file given by the teacher and reports an error. The specific error is as follows
insert image description here

solution

Option One

utf8mb4_0900_ai_ci is replaced by: utf8_general_ci

Option II

Upgrade the MySQL database version to MySQL 8.0+

reason

Due to the upgrade of the MySQL database version, the new MySQL version (such as MySQL 8.0) uses the default collation named utf8mb4_0900_ai_ci, but the old MySQL version (such as MySQL 5.x) does not support this collation. In fact, although solution one is relatively convenient, this solution is not recommended, because in the new MySQL version, the old collation may be deprecated or no longer supported, which may cause some problems. If you must use this workaround, first check the MySQL documentation to see if the collation you are using is supported. Option two is relatively cumbersome, but it is the recommended solution because newer MySQL versions have many new features and security improvements.

references

insert image description here
insert image description here

おすすめ

転載: blog.csdn.net/T_Y_F_/article/details/130497094