MySQL 1073

This error occurs when a BLOB column is used as a key in a table. It indicates that the column cannot be used as a key due to its large size.

How It Affects Your App

The error indicates that a BLOB column is being used as a key in a query. This can cause the query to fail, as BLOB columns are not suitable for use as keys. This can lead to unexpected results in the application, such as incorrect data being returned or the query failing altogether. It can also lead to performance issues, as the query may take longer to execute than expected. In addition, it can cause the application to become unstable, as the query may fail unexpectedly.

How To Fix

1. Check the syntax of the SQL statement that is causing the 1073 error. This can be done by running the statement in a MySQL client such as the MySQL command line client.
mysql> SELECT * FROM table_name;
ERROR 1073 (HY000): Unknown collation: 'utf8mb4_unicode_ci'
2. Check the character set and collation of the table in question. This can be done by running the following query:
mysql> SHOW TABLE STATUS LIKE 'table_name';
+------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
| table_name | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | 0 | 0 | 0 | NULL | 2020-09-17 11:45:02 | NULL | NULL | utf8_general_ci | NULL | | |
+------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+---------+
3. Change the character set and collation of the table to match the SQL statement. This can be done by running the following query:
mysql> ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Query OK, 0 rows affected (0.02 sec)
4. Run the SQL statement again to verify that the 1073 error has been fixed.
mysql> SELECT * FROM table_name;
+------+------+
| id | name |
+------+------+
| 1 | foo |
| 2 | bar |
+------+------+
2 rows in set (0.00 sec)
5. Use an automated database observability tool to monitor and fix the MySQL 1073 in question. Automated database observability tools can help detect and diagnose MySQL errors quickly and accurately. They can also provide insights into the performance of the database and help identify potential issues before they become problems. This can help ensure that the MySQL 1073 error does not occur again in the future.

Metis takes your database to the next level

The only way to

your database

Never worry about your
database again!

Start using Metis and get your database guardrails set up in minutes