[
https://issues.apache.org/jira/browse/AIRFLOW-3786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046267#comment-17046267
]
Jarek Potiuk commented on AIRFLOW-3786:
---------------------------------------
NOTE! For Airflow 1.10 this problem does not exist in MySQL 5.7 . Maximum size
of the index has been increased for mysql 5.7 and is enough to handle the
indexes.
> mysql initdb failes because the primary key is too large.
> ----------------------------------------------------------
>
> Key: AIRFLOW-3786
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3786
> Project: Apache Airflow
> Issue Type: Bug
> Components: database
> Affects Versions: 1.10.2
> Reporter: Thayne McCombs
> Priority: Major
>
> When running `airflow initdb` using a mysql server using the utf8mb character
> set, I get this error:
> ```
> sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError)
> (1071, 'Specified key was too long; max key length is 767 bytes') [SQL:
> '\nCREATE TABLE dag (\n\tdag_id VARCHAR(250) NOT NULL, \n\tis_paused BOOL,
> \n\tis_subdag BOOL, \n\tis_active BOOL, \n\tlast_scheduler_run DATETIME,
> \n\tlast_pickled DATETIME, \n\tlast_expired DATETIME, \n\tscheduler_lock
> BOOL, \n\tpickle_id INTEGER, \n\tfileloc VARCHAR(2000), \n\towners
> VARCHAR(2000), \n\tPRIMARY KEY (dag_id), \n\tCHECK (is_paused IN (0, 1)),
> \n\tCHECK (is_subdag IN (0, 1)), \n\tCHECK (is_active IN (0, 1)), \n\tCHECK
> (scheduler_lock IN (0, 1))\n)\n\n'] (Background on this error at:
> [http://sqlalche.me/e/e3q8)]
> ```
> I've found a few stack overflow questions from other users that have run into
> this problem, the workarounds given are to either enable innodb_large_prefix,
> (which I can't do) or use utf8 or ascii encoding for the database (not
> desirable). Ideally, this should just work, or at the very least, have well
> documented workarounds for this problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)