Skip to content

Fix: Set charset and collation to utf8mb4_general_ci to avoid unknown collation error #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cuongpham2107
Copy link

Problem

When executing the SQL query, I encountered the following error:

Unknown collation: 'utf8mb4_0900_ai_ci'

This typically happens when the MySQL server version is older and doesn't support the 'utf8mb4_0900_ai_ci' collation (which was introduced in MySQL 8.0).

Solution

To ensure broader compatibility, I updated the database configuration to explicitly use:

  • charset: utf8mb4
  • collation: utf8mb4_general_ci

This collation is widely supported across MySQL versions and still provides good Unicode support.

Notes

Tested the connection and confirmed the error no longer occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant