Connect MySQL

Reverse Migrations only needs to read schema metadata - tables, columns, data types, constraints, and indexes. It never reads the actual rows in your tables.

1. Create the service account

Connect to your MySQL server as an administrator (for example root) and run:

SQL · MySQL
CREATE USER 'reverse_migrations'@'%' IDENTIFIED BY 'a-strong-password';

2. Grant schema introspection privileges

MySQL’s INFORMATION_SCHEMA is a virtual database that filters results based on the privileges you hold. To see table and column metadata, the account needs SELECT on the database(s) you want to introspect. Reverse Migrations also inspects views, which requires SHOW VIEW; without it, introspection fails when the database contains a view.

Run the following for each database you want to use:

SQL · MySQL
GRANT SELECT, SHOW VIEW ON your_database.* TO 'reverse_migrations'@'%';

3. Verify the account works

Log in as reverse_migrations and confirm you can read schema information:

SQL · MySQL
USE your_database;
SHOW TABLES;
DESCRIBE some_table;
SHOW INDEX FROM some_table;
SHOW CREATE VIEW some_view;

Replace some_table and some_view with existing objects. Skip the last command if the database has no views. These database-level grants also apply to tables and views created later; they do not grant permission to insert, update, delete, or alter tables.

4. Use this credential in the dashboard

Copy the username (reverse_migrations) and password into the workspace when you select Add database and choose MySQL.

References

Documentation - Reverse Migrations