MySQL and MariaDB specifics for Atlas schema management: dev database scope, character sets, users/grants, enums, generated columns, foreign-key indexes, triggers, stored programs, lint checks, partial migration failures, managed services, and custom lint rules.
Ships in Atlas. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
What is specific to MySQL and MariaDB when Atlas manages the schema. The atlas skill covers the
workflows and commands; this skill covers the rules, edge cases, and answers that differ on MySQL.
MariaDB is covered where it differs. MySQL-compatible engines, such as TiDB, PlanetScale, and
SingleStore, are not covered.
This skill is SKILL.md plus seven reference files under references/, each served at
https://atlasgo.io/skills/atlas-mysql/references/<name>. Read a reference when the task needs it:
| File | Read it for |
|---|---|
references/dev-database.md | The dev URL and its scope, atlas tool docker, the docker block, character sets and collations, RDS, Cloud SQL, Azure, MariaDB, connection URLs |
references/security.md | Users and roles, hosts, GRANT and REVOKE, passwords, role activation |
references/objects.md | What needs a login, enums and sets, foreign-key indexes, checks, generated columns, functions and triggers, normalized definitions, MariaDB |
references/hcl.md | Writing the schema in HCL: the NOT NULL default, defaults and ON UPDATE, AUTO_INCREMENT, types, indexes, engines, partitions, views, routines, seed data |
references/migrations.md | MY* lint findings, table copies, partial failures and recovery, delimiters, locks, the revisions table, baselines |
references/testing.md | Testing every change: schema tests, migration tests with seeded rows, CI |
references/custom-rules.md | Writing a custom lint rule in the HCL rule language when no analyzer covers a check: predicates, operators, what each MySQL object exposes, examples |
The atlas skill, installed next to this one (../atlas/SKILL.md). If it is missing, download
https://atlasgo.io/skills/atlas/SKILL.md to ../atlas/SKILL.md and each reference file listed in its
Files section to ../atlas/references/<name>.
atlas whoami. If it shows no login, ask the user to run atlas login:
logged out, Atlas misses views, triggers, stored procedures, functions, partitions, and users and
grants. A user without an account can start a free trial with atlas login.users). Server scope, no database in the path:
Atlas covers every database and qualifies each statement (app.users).DROP DATABASE.docker://mysql/8/dev, or docker://mysql/8.lower_case_table_names, sql_mode, and explicit_defaults_for_timestamp. A docker block pins
the image (image = "mysql:8.4") and starts the server with the target's settings (command). Use
a MariaDB dev database for MariaDB. On RDS, migrations that create IAM users
(IDENTIFIED WITH AWSAuthenticationPlugin) need a dev image with a mock of the plugin
(references/dev-database.md). Never point dev at a real environment's database.charset and collate on every schema block. Otherwise the desired state takes the dev
server's defaults, utf8mb4_0900_ai_ci on MySQL 8, and a schema-scoped plan against a target with
other defaults fails with a modify schema error (references/dev-database.md).mode { roles = true }. MySQL has no external
attribute, so an undeclared account is planned for a drop, including the user Atlas connects as:
declare it, review the first plan for other accounts, and set drop_user and drop_role in the
skip diff policy to keep drops out of plans. Granted roles take effect only after
SET DEFAULT ROLE (references/security.md).--tx-mode cannot prevent it. Keep files
small and test them before applying (Rule 9). To recover, fix the failed statement and the ones
after it and run atlas migrate hash, or undo the applied statements with atlas migrate down
(references/migrations.md).MY1* lint finding before applying to a large table: those changes copy or rebuild the
table, or block writes. Add enum and set values at the end, prefer VIRTUAL generated columns, and
check engine edits (references/migrations.md)._utf8mb4
introducers, and can plan to drop the index MySQL created for a foreign key
(references/objects.md).atlas schema validate, add a
test "schema" case for each function, procedure, trigger, view, generated column, or check you add
or change, and a test "migrate" case with seeded rows for each migration that moves or converts
data. Run them with atlas schema test and atlas migrate test (references/testing.md).references/custom-rules.md).| Question | Answer |
|---|---|
| A local MySQL database to apply migrations to | atlas tool docker --url "docker://mysql/8/myapp" --name my-db prints its URL; atlas tool docker kill --name my-db stops it (references/dev-database.md) |
modify schema "..." is not allowed when migration plan is scoped to one schema | The dev database's charset, collation, or comment differ from the target's (references/dev-database.md) |
| Every table shows a charset or collation change | The dev server's defaults leaked into the desired state: declare them on the schema, or match the dev server to the target (references/dev-database.md) |
Drift that differs only by _latin1 or _utf8mb4 | Start the dev server with the target's character set through command (references/dev-database.md) |
| Table names keep showing as changed | The dev server's lower_case_table_names differs from the target's (references/dev-database.md, Server Versions and Settings) |
A plan drops other databases (DROP DATABASE) | Server scope covers every database: limit the run with --schema, or use schema scope (references/dev-database.md) |
Error 1046: No database selected | A schema-scoped plan applied through a server-scoped URL (references/dev-database.md) |
cannot use HCL with more than 1 schema when dev-url is limited to schema | Use a server-scoped dev URL, docker://mysql/8 (references/dev-database.md) |
A migration failed halfway, and migrate status shows (last one partially) | MySQL kept the statements before the failure: fix the rest and run atlas migrate hash, or undo them with atlas migrate down (references/migrations.md) |
| A rename shows up as a drop and an add | Declare it with renamed_from, or the data is lost (references/hcl.md) |
Lint reports MY1* checks | The change copies or rebuilds the table, or blocks writes. To avoid the copy, force ALGORITHM=INSTANT in a hand-written file, or use an online schema change tool (references/migrations.md, Table Copies) |
Error 1553 (HY000): Cannot drop index ...: needed in a foreign key constraint | Plan with a dev URL, or declare the foreign key's index (references/objects.md) |
| Foreign keys never show up in inspection or plans | The table uses MyISAM, which ignores foreign keys: use InnoDB (references/objects.md) |
Error 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA ... | Set deterministic or data_access, or enable log_bin_trust_function_creators (references/objects.md) |
Removing an enum value fails, or turns rows into '' | Strict sql_mode fails on rows that hold the value, and non-strict mode blanks them: update those rows first (references/objects.md) |
Error 1826 or Error 3822, a duplicate constraint name | Foreign key and check names are unique per database, not per table (references/objects.md) |
Error 1059 (42000): Identifier name ... is too long | Names are limited to 64 characters: name the index or constraint explicitly (references/objects.md) |
Error 1227 (42000): Access denied on a DEFINER clause, on RDS | Remove DEFINER clauses from the migration files (references/objects.md) |
Error 1146 (42S02): Table ... doesn't exist when loading a view | The view reads another database: create it in the dev baseline, or use server scope (references/objects.md) |
IDENTIFIED WITH mysql_native_password fails on the dev database | MySQL 8.4 disables the plugin and 9.0 removes it: run the dev database on the target's version (references/dev-database.md) |
Error 1067: Invalid default value on a timestamp | Write the default as sql("current_timestamp(6)"), with the column's precision (references/hcl.md) |
A column became NOT NULL without asking for it | HCL columns are NOT NULL unless they set null = true (references/hcl.md) |
ERROR 1170 (42000): BLOB/TEXT column ... used in key specification without a key length | Give the index part a prefix (references/hcl.md) |
| Users or roles the schema does not declare are planned for a drop | Declare them, or skip drops with drop_user and drop_role (references/security.md) |
| Granted roles have no effect | On MySQL, run SET DEFAULT ROLE ALL TO 'user'@'host', or enable activate_all_roles_on_login. On MariaDB, a user has one default role: SET DEFAULT ROLE <role> FOR 'user'@'host' (references/security.md) |
Error 1524 (HY000): Plugin 'AWSAuthenticationPlugin' is not loaded, from migrations that create RDS IAM users | Build the dev image with a mock of the plugin, and start local databases from it with atlas tool docker --env <env> (references/dev-database.md, RDS IAM users on the dev database) |
invalid port ":..." after host | Percent-encode the password, or build the URL with urlescape (references/dev-database.md) |
server does not allow insecure connections, client must use SSL/TLS | Add ?tls=true to the URL (references/dev-database.md) |
| Databases on one server never apply in parallel | They share the default lock name: set lock_name per target (references/migrations.md) |
references/custom-rules.md (opens in a new tab)references/dev-database.md (opens in a new tab)references/hcl.md (opens in a new tab)references/migrations.md (opens in a new tab)references/objects.md (opens in a new tab)references/security.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/atlas:atlas-mysqlfrom Atlas
npx claudepluginhub ariga/atlas --plugin atlas14 skills in this plugin
/atlasDatabase schema management, migrations, data scripts, and Atlas Cloud operations with the Atlas CLI. Use when: generating or applying migrations, diffing, linting, validating, or testing schemas, working with atlas.hcl, schema.hcl, or ORM schemas (GORM, Drizzle, SQLAlchemy, Django, Ent, Sequelize, TypeORM, Prisma), running data backfills, purges, or reports with atlas script, or answering questions about Atlas Cloud: which databases are synced, pending, or failed, recent or failed deployments, what is waiting for deployment, registry repos, and pending plan approvals./atlas-actionAtlas in CI/CD pipelines with the Atlas actions: ariga/setup-atlas and ariga/atlas-action on GitHub Actions, the GitLab CI components, the CircleCI orb, the Bitbucket pipe, and the Azure DevOps AtlasAction task. The CI/CD steps (migrate lint, push, diff, hash, autorebase, test, apply, down, set, drift; schema plan, plan approve, push, apply, lint, test; script exec, query, loop, test, push; security scan; monitor schema; create-repo) with its inputs, outputs, tokens, permissions, and pull request comments, plus pinning versions, runners, and fixing a failed run. Use with the atlas skill whenever a pipeline runs Atlas or an Atlas check in CI fails./atlas-clickhouseClickHouse specifics for Atlas: the login-only driver, dev database and URL scope (database vs server), Docker dev images and version checks, cluster mode and ON CLUSTER, table engines, sort keys and table rebuilds, plans that skip destructive changes without a terminal, table recreation and the allow_recreate policy, mutations and CH lint checks, materialized views, dictionaries, UDFs and WASM, named collections, users, roles, grants, row policies and settings profiles, secret settings and the sensitive mode, no transactions and no lock, ClickHouse Cloud, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a ClickHouse database./atlas-databricksDatabricks specifics for Atlas: the extended binary and login, connection URLs and scope (catalog vs schema), the dev catalog (no Docker), Delta table properties, managed and external tables, partitioning and liquid clustering, generated and identity columns, defaults and column mapping, renames, informational keys and checks, collations, column masks and row filters, views, metric views, and materialized views, SQL and Python functions, procedures, Unity Catalog grants, no transactions and no locks, partial failures, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a Databricks database. For Databricks Lakebase, use atlas-lakebase./atlas-lakebaseDatabricks Lakebase specifics for Atlas: the databricks_lakebase_token data source and the Databricks credentials it uses (a CLI profile, or a service principal with the workspace-access entitlement), the endpoint host instead of the -pooler host, the Postgres role in the URL, password roles, the objects Lakebase manages in every database (__db_system, three grant_* functions, three on_create_* event triggers) and how to exclude them at schema and database scope, the first migrate apply, drift checks, object ownership, and Lakebase errors. Use with the atlas and atlas-postgres skills whenever Atlas manages a Databricks Lakebase database./atlas-mssqlSQL Server specifics for Atlas (also Azure SQL and MSSQL): login, Azure SQL sign-in with Microsoft Entra ID (fedauth, no password), dev database and URL scope (mode=schema vs mode=database, the database query parameter), compatibility level and collation, system-generated constraint names, clustered index defaults and datetime2 precision in HCL, GO batches and the delimiter directive, transactions and statements that cannot run in one, identity, computed and temporal columns, alias and table types, changes planned as a drop and an add, what Atlas leaves out (DENY, synonyms, row-level security, sparse columns), database roles, users and grants, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a SQL Server or Azure SQL database.Other plugins' skills for the same job