pingzh opened a new issue, #25144:
URL: https://github.com/apache/airflow/issues/25144

   ### Apache Airflow version
   
   2.2.4
   
   ### What happened
   
   Airflow db init fails on mysql 5.7 due to :
   
   `Specified key was too long; max key length is 767 bytes`
   
   On mysql 5.7,  the index key prefix limit is 767 bytes for tables see: 
https://dev.mysql.com/doc/refman/5.7/en/innodb-limits.html when 
`innodb_large_prefix` is `OFF` or it  use the REDUNDANT or COMPACT row format. 
   and mysql 5.7 uses utf8mb3 charset (which is utf8), thus the max length for
   index key should be 251
   
   The following key length leads to the error:
   
https://github.com/apache/airflow/blob/808035e00aaf59a8012c50903a09d3f50bd92ca4/airflow/models/pool.py#L48
   
   
https://github.com/apache/airflow/blob/808035e00aaf59a8012c50903a09d3f50bd92ca4/airflow/models/xcom.py#L61
   
   (we don't really need that long key ^^)
   
   
https://github.com/apache/airflow/blob/808035e00aaf59a8012c50903a09d3f50bd92ca4/airflow/migrations/versions/0061_2_0_0_increase_length_of_pool_name.py#L44
   
   ### What you think should happen instead
   
   `airflow db init` should works for mysql 5.7
   
   ### How to reproduce
   
   _No response_
   
   ### Operating System
   
   Apple M1 Max, version: 12.2
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to