Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Rahul2322's avatar

Migration error in Laravel 11

Hello everyone. Please help me to fix this error. command :php artisan migrate Illuminate\Database\QueryException

SQLSTATE[HY000]: General error: 1273 Unknown collation: 'utf8mb4_0900_ai_ci' (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'store' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

Change the default mysql.collation key in config/database.php to something that your database version actually supports.

2 likes
bloodykheeng's avatar

add this to your env file DB_COLLATION=utf8mb4_unicode_ci

Please or to participate in this conversation.