• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error 1273 – SQLSTATE: HY000 (ER_UNKNOWN_COLLATION) Unknown collation: ‘%s’

December 20, 2023

How to Fix MySQL Error 1273 – SQLSTATE: HY000 (ER_UNKNOWN_COLLATION) Unknown collation: ‘%s’

MySQL is a popular open-source relational database management system used by many websites and applications. However, like any software, it can encounter errors that can disrupt its normal operation. One such error is MySQL Error 1273 – SQLSTATE: HY000 (ER_UNKNOWN_COLLATION) Unknown collation: ‘%s’. This error occurs when MySQL encounters an unknown collation during a query execution.

Understanding Collation in MySQL

In MySQL, collation refers to the rules used to compare and sort characters in a database. It determines how string comparison and sorting operations are performed. Each character set in MySQL has a default collation, which can be overridden at the table or column level.

Collation is important because it affects how string comparisons are made. For example, in a case-insensitive collation, ‘apple’ and ‘Apple’ would be considered equal, while in a case-sensitive collation, they would be considered different.

Causes of MySQL Error 1273

MySQL Error 1273 occurs when a query references a collation that is not recognized by the MySQL server. This can happen for several reasons:

  • The collation specified in the query is misspelled or does not exist.
  • The collation specified is not supported by the MySQL server.
  • The collation specified is valid, but it is not available for the specific character set being used.

Fixing MySQL Error 1273

To fix MySQL Error 1273, you can try the following solutions:

1. Check the Collation Name

Ensure that the collation name specified in the query is correct and exists in the MySQL server. Check for any typos or misspellings. You can refer to the MySQL documentation for a list of supported collations.

2. Change the Collation

If the collation specified is not supported by the MySQL server, you can try changing it to a supported collation. You can alter the table or column collation using the ALTER TABLE or ALTER COLUMN statements.

ALTER TABLE table_name CONVERT TO CHARACTER SET charset_name COLLATE collation_name;

Replace table_name with the name of the table and collation_name with a supported collation.

3. Change the Character Set

If the collation specified is valid but not available for the character set being used, you can try changing the character set. You can alter the table or column character set using the ALTER TABLE or ALTER COLUMN statements.

ALTER TABLE table_name CONVERT TO CHARACTER SET charset_name COLLATE collation_name;

Replace table_name with the name of the table and charset_name with a supported character set.

4. Update MySQL Server

If none of the above solutions work, it is possible that your MySQL server version does not support the collation you are trying to use. In this case, consider updating your MySQL server to a newer version that supports the desired collation.

Summary

MySQL Error 1273 – SQLSTATE: HY000 (ER_UNKNOWN_COLLATION) Unknown collation: ‘%s’ occurs when MySQL encounters an unknown collation during a query execution. To fix this error, ensure that the collation name specified in the query is correct and exists in the MySQL server. If the collation is not supported or not available for the character set being used, consider changing the collation or character set. If all else fails, updating your MySQL server to a newer version may resolve the issue.

For reliable and high-performance VPS hosting solutions, consider Server.HK. Our Hong Kong VPS hosting services offer top-notch performance and reliability for your website or application.

Recent Posts

  • NVMe SSD vs SATA SSD for VPS Hosting: Does Storage Type Really Matter?
  • Hong Kong VPS Docker Setup: Run Containers with Full Root Access
  • How to Set Up a Game Server on Hong Kong VPS: Low-Latency Gaming for Asia
  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide
  • How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

Recent Comments

  1. hello world on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot