{"id":23495,"library":"dagster-mysql","title":"dagster-mysql","description":"A Dagster integration library for MySQL, providing a MySQLEventLogStorage and MySQLRunStorage for persisting Dagster event logs and run metadata in MySQL. Compatible with Dagster 1.13.x (library version 0.29.x). Released as part of the main Dagster monorepo on a weekly cadence.","status":"active","version":"0.29.3","language":"python","source_language":"en","source_url":"https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-mysql","tags":["dagster","mysql","storage","event-log","run-storage"],"install":[{"cmd":"pip install dagster-mysql","lang":"bash","label":"default"}],"dependencies":[{"reason":"Core dependency; dagster-mysql is an extension plugin.","package":"dagster","optional":false},{"reason":"Required for MySQL connectivity.","package":"mysql-connector-python","optional":false}],"imports":[{"note":"Use dagster_mysql, not a submodule like dagster_mysql.storage.","symbol":"MySQLEventLogStorage","correct":"from dagster_mysql import MySQLEventLogStorage"},{"note":"Use dagster_mysql, not a submodule.","symbol":"MySQLRunStorage","correct":"from dagster_mysql import MySQLRunStorage"},{"note":"Simple import works; the library auto-exports the main classes.","symbol":"dagster_mysql","correct":"import dagster_mysql"}],"quickstart":{"code":"from dagster_mysql import MySQLEventLogStorage, MySQLRunStorage\n\n# Example configuration dict for the MySQL storage backends\nconfig = {\n    \"mysql_host\": os.environ.get(\"MYSQL_HOST\", \"localhost\"),\n    \"mysql_port\": int(os.environ.get(\"MYSQL_PORT\", \"3306\")),\n    \"mysql_user\": os.environ.get(\"MYSQL_USER\", \"root\"),\n    \"mysql_password\": os.environ.get(\"MYSQL_PASSWORD\", \"\"),\n    \"mysql_db_name\": os.environ.get(\"MYSQL_DB_NAME\", \"dagster\"),\n}\n\n# Create storage instances\nevent_log_storage = MySQLEventLogStorage.from_local(**config)\nrun_storage = MySQLRunStorage.from_local(**config)\n\n# Verify connection (raises if cannot connect)\nprint(\"Connected to MySQL successfully.\")","lang":"python","description":"Basic setup to connect MySQL event log and run storage. Requires a running MySQL server."},"warnings":[{"fix":"Review the Dagster documentation for MySQL storage limitations.","message":"MySQLEventLogStorage and MySQLRunStorage are not drop-in replacements for the default Postgres-based storages. They have different schema and may not support all features (e.g., certain query optimizations).","severity":"gotcha","affected_versions":"all"},{"fix":"Explicitly provide `mysql_host`, `mysql_port`, etc., either via code or environment.","message":"The MySQL storage backends use `mysql-connector-python` under the hood. If you encounter connection issues, ensure the MySQL server is reachable and the credentials are correct. The `from_local` method does not use environment variables by default; you must pass them explicitly.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate schedule storage to the default Dagster storage backend (Postgres).","message":"As of Dagster 1.13, `MySQLScheduleStorage` has been deprecated in favor of using a centralized schedule storage via Dagster Cloud or the core Postgres storage. Direct MySQL schedule storage may be removed in future versions.","severity":"deprecated","affected_versions":">=1.13.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install mysql-connector-python: `pip install mysql-connector-python`","cause":"Missing mysql-connector-python dependency.","error":"ModuleNotFoundError: No module named 'mysql'"},{"fix":"Verify MYSQL_USER, MYSQL_PASSWORD, and that the user has remote access permissions.","cause":"Invalid MySQL credentials or host not allowed to connect.","error":"OperationalError: (mysql.connector.errors.OperationalError) 1045 (28000): Access denied for user 'root'@'...'"},{"fix":"Use `from dagster_mysql import MySQLEventLogStorage`. If using an older version, import from `dagster_mysql.event_log`.","cause":"Old versions of dagster-mysql (<0.28) exported from submodules; the preferred import path changed.","error":"ImportError: cannot import name 'MySQLEventLogStorage' from 'dagster_mysql'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}