#1273 - Unknown collation: 'utf8mb4_0900_ai_ci' Error- Easy FIX
A very common mysql error “#1273 – Unknown collation: ‘utf8mb4_0900_ai_ci'” Error- Easy fixing method. This error ismostly due to the php version changes.
Find the string “utf8mb4_0900_ai_ci” and replace it with “utf8mb4_general_ci“.
STEPS
1. Open your SQL file in any text editor
2. Use find and replace
3. Find all
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
4. Replace to
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
5. Save the file
6. Import the file again
If you've been working with MySQL databases, you may have come across the error '1273 - Unknown collation: 'utf8mb4_0900_ai_ci'. This error occurs when trying to create or alter a table that uses a collation that is not supported by the MySQL server.
The 'utf8mb4_0900_ai_ci' collation is a 'case-insensitive' collation that was introduced in MySQL 8.0. It is designed to improve the performance of queries that use case-insensitive comparisons. However, it is not available in earlier versions of MySQL, which is why you may be seeing this error.
The solution to this error is to either upgrade your MySQL server to version 8.0 or above, or use a different collation. The 'utf8_general_ci' collation is a good alternative, as it is supported by all versions of MySQL. It is also case-insensitive, so it will work for case-insensitive comparisons.
To change the collation of an existing table, you can use the ALTER TABLE command. For example, if you wanted to change the collation of the 'mytable' table to 'utf8_general_ci', you would use the following command:
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
This will change the collation of the table to 'utf8_general_ci', which should resolve the '1273 - Unknown collation: 'utf8mb4_0900_ai_ci' error.
In summary, the '1273 - Unknown collation: 'utf8mb4_0900_ai_ci' error occurs when trying to create or alter a table that uses a collation that is not supported by the MySQL server. The solution is to either upgrade your MySQL server to version 8.0 or above, or use a different collation such as 'utf8_general_ci'. You can use the ALTER TABLE command to change the collation of an existing table.
If you're using MySQL databases in an application that requires case-insensitive comparisons, it is recommended that you upgrade to MySQL 8.0 or above. This will ensure that you have the latest collations available, and will prevent the '1273 - Unknown collation: 'utf8mb4_0900_ai_ci' error.
In addition, it is important to ensure that all of the tables in your database have the same collation. This will ensure that the queries you run are as efficient as possible, and will prevent errors caused by different collations. You can use the SHOW TABLE STATUS command to see what collation each of your tables is using.
Finally, if you're unable to upgrade to MySQL 8.0 or above, it's important to remember that there are alternative collations available that are supported by all versions of MySQL. The 'utf8_general_ci' collation is a good choice for case-insensitive comparisons, and is supported by all versions of MySQL.
The ‘1273 - Unknown collation: 'utf8mb4_0900_ai_ci' error is an error that occurs when trying to create or alter a table that uses a collation that is not supported by the MySQL server. The 'utf8mb4_0900_ai_ci' collation is a case-insensitive collation that was added in MySQL 8.0 and is not supported by earlier versions of MySQL.
In order to resolve this error, there are a few different solutions available. The first option is to upgrade your MySQL server to version 8.0 or above, which will enable you to use the 'utf8mb4_0900_ai_ci' collation. Alternatively, you can use a different collation such as 'utf8_general_ci', which is supported by all versions of MySQL.
In order to change the collation of an existing table, you can use the ALTER TABLE command. For example, if you wanted to change the collation of the 'mytable' table to 'utf8_general_ci', you would use the following command:
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
It is also important to ensure that all of the tables in your database have the same collation. This will ensure that the queries you run are as efficient as possible, and will prevent errors caused by different collations. You can use the SHOW TABLE STATUS command to see what collation each of your tables is using.
By following these steps, you should be able to resolve the '1273 - Unknown collation: 'utf8mb4_0900_ai_ci' error. If you're using MySQL databases in an application that requires case-insensitive comparisons, it is recommended that you upgrade to MySQL 8.0 or above. This will ensure that you have the latest collations available and will help to prevent this error in the future.
Facebook page:
/ sobujitpark
Facebook group:
/ sobujitpark
Информация по комментариям в разработке