Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate issue with MySQL 9.0.1 on Mac #480

Open
qwikops opened this issue Feb 1, 2025 · 1 comment
Open

Migrate issue with MySQL 9.0.1 on Mac #480

qwikops opened this issue Feb 1, 2025 · 1 comment

Comments

@qwikops
Copy link

qwikops commented Feb 1, 2025

Bug Report

Description

MySQLdb.OperationalError: (1071, 'Specified key was too long; max key length is 3072 bytes')

Getting this error when running manage.py migrate. Please note make migrations work just fine. I get this error when it tries to create Payroll.001_initial models

Applying payroll.0001_initial...Traceback (most recent call last):
django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 3072 bytes')

Steps to Reproduce

Follow the steps in your tutorial to use MySQL. It always fails at Payroll.001_initia level

Environment

  • Django Version: 4.2.11
  • Python Version: 3.12.4
  • Operating System: macOS Sonoma 14.5
  • Browser:

001_Initial.pdf

@horilla-opensource
Copy link
Owner

Hi @qwikops ,

Thank you for reporting this issue! It looks like this is related to MySQL's key length limitation.

Horilla is primarily designed to work with SQLite for testing and PostgreSQL for production, so we recommend trying one of these databases instead.

If you must use MySQL, you may need to adjust your database settings or reduce indexed field lengths to work around this limitation. Please let us know if switching to SQLite or PostgreSQL resolves the issue!

Looking forward to your update.

Best Regards,
Team Horilla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants