Skip to content

Commit

Permalink
Fix MySQL database character set instruction (apache#17603)
Browse files Browse the repository at this point in the history
The currently instructed character set `utf8mb4 COLLATE utf8mb4_unicode_ci;` does not work on mysql 8. 
When I do: `airflow db init` the following error occurs:
`
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1071, 'Specified key was too long; max key length is 3072 bytes')
`
Changing to this character set: `utf8 COLLATE utf8_general_ci;` solved the problem
  • Loading branch information
tdnguyen6 authored Aug 13, 2021
1 parent 833e109 commit 88e3379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/apache-airflow/howto/set-up-database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ In the example below, a database ``airflow_db`` and user with username ``airflo

.. code-block:: sql
CREATE DATABASE airflow_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE airflow_db CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'airflow_user' IDENTIFIED BY 'airflow_pass';
GRANT ALL PRIVILEGES ON airflow_db.* TO 'airflow_user';
Expand Down

0 comments on commit 88e3379

Please sign in to comment.