After updating my local Open edX environment with the latest code from the git repository my Tutor- ver 20.0.1 based local deployment on Ubuntu started failing during migrations.
When I run:
tutor local launch
or
tutor local run lms ./manage.py migrate
the process stops with this error:
django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')
Environment Details:
-
OS: Ubuntu (local system)
-
Deployment type: Tutor local (development mode)
-
Tutor version: 20.0.1
-
Database: MySQL (running inside Tutor Docker container)
What I Tried:
-
Checked container status with:
docker ps -a→ All Tutor containers (
mysql,lms,cms, etc.) are created but MySQL stops after a few seconds during migrations. -
Verified connection manually inside container:
tutor local run mysql mysql -u root -p→ Connection succeeds, but large migrations cause MySQL to drop.
-
Error occurs consistently at:
Applying api_admin.0003_auto_20160404_1618... Lost connection to MySQL server during query
Possible Cause (Analysis):
-
The MySQL server inside Tutor may have default configuration limits that are too low for heavy Open edX migrations.
-
The
max_allowed_packet,wait_timeout, orinnodb_log_file_sizeparameters might need to be increased. -
Docker resource allocation (CPU/RAM) may also be insufficient for running the full Open edX stack locally.
Proposed Fix / Next Steps:
-
Create or edit a custom MySQL configuration:
mkdir -p $(tutor config printroot)/mysql nano $(tutor config printroot)/mysql/my.cnfAdd:
[mysqld] max_allowed_packet=256M wait_timeout=28800 interactive_timeout=28800 innodb_log_file_size=512M -
Restart Tutor services:
tutor local stop tutor local start -d -
Re-run migrations:
tutor local run lms ./manage.py migrate -
Increase Docker resources (CPU ≥ 4 cores, RAM ≥ 8 GB).
Expected Behavior:
Open edX migrations should complete successfully and all services (lms, cms, mysql, caddy, etc.) should start without MySQL disconnection errors.
Actual Behavior:
Migrations fail midway with:
OperationalError: (2013, 'Lost connection to MySQL server during query')
Help me how to resovle it
i want it intergarion my web and mobile app bypass the login and customization so help me how to resovele it