Unknown collation: 'utf8mb4_0900_ai_ci'; This error is because the local server and live server have different versions of MYSQL. To solve this error follow the step guideline.
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.
- 1. Open your .sql file in any editor, Which you imported from the MYSQL server.
- 2. Find 'utf8mb4_0900_ai_ci' With given table name.
- 3. Replace and save the .sqi file and upload it to the MYSQL server.
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Goto to your .sql file, and replace it with
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Example With Posts Table
CREATE TABLE `posts` ( `id` bigint UNSIGNED NOT NULL, `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `post_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `source_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; // REMOVE THIS
Replace with the below ENGINE=InnoDB.
CREATE TABLE `posts` ( `id` bigint UNSIGNED NOT NULL, `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `post_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `source_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; // ADD THIS
We always thanks to you for reading our blogs.
Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us
Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- MongoDB Database Connection In Laravel
- ERROR: database "laravel" is being accessed by other users DETAIL: There is 1 other session using the database.
- Laravel 6 installation with MongoDB Database
- How To Install MongoDB In Ubuntu
- [FIXED] Unknown Collation: utf8mb4_0900_ai_ci In MYSQL
- SOLVED # 1118 Row size too large 8126. Changing some columns to TEXT or BLOB
- The Syntax of MySQL
- MongoDB Database Installation
- How To Improve SQL Query Performance
- How To Change ENUM DataType Without Losing Data Laravel Migration