Unknown Collation [FIXED] : utf8mb4_0900_ai_ci In MYSQL Share
In this post, we are going to teach you, how to fixed unknown collation utf8mb4_0900_ai_ci error In MYSQL.
Unknown collation: 'utf8mb4_0900_ai_ci': This error is because the local server and live server have different versions of MYSQL. It means the error is because of a different version of MYSQL from were you exporting your SQL database and where you importing also a different version of MYSQL.
To solve this error follow the step guideline:
- Open your .sql file in any editor(Notepad), Which you imported from the MYSQL server.
- Find 'utf8mb4_0900_ai_ci' With given table name.
- Replace and save the .sql file.
- Upload it to the MYSQL server.
Error Line in your SQL file:
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Solution: Open your .sql file, and replace it with this code.
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Previous SQL Example:
CREATE TABLE `studnet` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; // REMOVE THIS LINE
Correct SQL Example:
CREATE TABLE `studnet` (
`id` bigint UNSIGNED NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; // ADD THIS LINE





Click to Join









Comments 0