The PlanetScale Discovery CLI can analyze MySQL and MySQL-compatible databases including standard MySQL, MariaDB, Percona Server, Amazon Aurora MySQL, Google Cloud SQL for MySQL, Azure Database for MySQL, and PlanetScale (Vitess). The tool collects metadata about database configuration, schema structure, performance characteristics, replication topology, and feature usage without accessing actual table data.
Cloud provider support: MySQL discovery is supported on AWS RDS MySQL, Aurora MySQL, GCP Cloud SQL MySQL, and Azure Database for MySQL Flexible Server. The Supabase, Heroku Postgres, and Neon providers are PostgreSQL-only.
- MySQL-compatible database server (MySQL 5.7+, MySQL 8.0+, MariaDB 10.x, or compatible)
- Database user with read-only access to
information_schemaand system tables - Python package:
pip install "ps-discovery[mysql]"(or select MySQL during./setup.sh)
# Install with MySQL support
pip install "ps-discovery[mysql]"
# Run discovery against a MySQL server directly
ps-discovery database --engine mysql --host db.example.com -u root -W
# Or run with a config file
ps-discovery --config mysql-config.yaml
# Generate a MySQL configuration template
ps-discovery config-template --output mysql-config.yaml --engines mysqlps-discovery database --engine mysql \
--host db.example.com \
--port 3306 \
--username discovery_user \
-W # prompts for passwordengine: mysql
mysql:
host: db.example.com
port: 3306
database: "" # Leave empty to discover all databases
username: discovery_user
password: your_password
ssl_mode: disabledThen run (the engine and modules come from the config):
ps-discovery --config mysql-config.yamlexport MYSQL_HOST=db.example.com
export MYSQL_PORT=3306
export MYSQL_USER=discovery_user
export MYSQL_PASSWORD=your_password
export MYSQL_SSL_MODE=disabled
export DISCOVERY_ENGINE=mysqlThen run with minimal flags:
ps-discovery database --engine mysqlCreate a dedicated read-only user for discovery:
-- Create the discovery user
CREATE USER 'planetscale_discovery'@'%' IDENTIFIED BY 'secure_password_here';
-- Grant read access to all databases (for schema analysis)
GRANT SELECT ON *.* TO 'planetscale_discovery'@'%';
-- Grant process privilege (for performance analysis, SHOW PROCESSLIST)
GRANT PROCESS ON *.* TO 'planetscale_discovery'@'%';
-- Grant replication client (for binary log and replica status)
GRANT REPLICATION CLIENT ON *.* TO 'planetscale_discovery'@'%';
-- Apply changes
FLUSH PRIVILEGES;The same grants apply. Create the user through the RDS master user:
CREATE USER 'planetscale_discovery'@'%' IDENTIFIED BY 'secure_password_here';
GRANT SELECT ON *.* TO 'planetscale_discovery'@'%';
GRANT PROCESS ON *.* TO 'planetscale_discovery'@'%';
GRANT REPLICATION CLIENT ON *.* TO 'planetscale_discovery'@'%';Note: Some RDS-specific status variables may not be accessible. The tool handles this gracefully and reports any gaps.
Same grants as standard MySQL. If using Cloud SQL Auth Proxy, configure the proxy connection details as the host:
mysql:
host: 127.0.0.1 # Cloud SQL Proxy listens locally
port: 3306
username: planetscale_discovery
password: your_passwordFor PlanetScale databases, your existing database credentials are sufficient. The discovery tool automatically detects PlanetScale/Vitess environments and adapts its queries accordingly.
ps-discovery database --engine mysql \
--host aws.connect.psdb.cloud \
--username your_branch_username \
-W \
--ssl-mode requiredOr via config:
engine: mysql
mysql:
host: aws.connect.psdb.cloud
port: 3306
username: your_branch_username
password: your_branch_password
ssl_mode: requiredPlanetScale-specific behavior:
- The tool detects scoped
information_schema(Vitess) and automatically falls back to per-database iteration - System databases (
_vt,mysql,performance_schema) are excluded - Features not supported by Vitess (e.g., foreign keys in older versions, stored procedures) are detected and reported
The ssl_mode setting controls how the connection to MySQL is secured:
| Mode | Description |
|---|---|
disabled |
No SSL (default for local connections) |
preferred |
Use SSL if available, fall back to unencrypted |
required |
Require SSL, but don't verify the server certificate |
verify-ca |
Require SSL and verify the server certificate against the CA |
verify-identity |
Require SSL, verify the certificate, and verify the hostname |
For PlanetScale and most cloud-hosted MySQL instances, use required or higher.
- MySQL version, distribution (MySQL, MariaDB, Percona, Aurora), and build information
- Server variables (
SHOW GLOBAL VARIABLES) - Cloud platform detection (RDS, Aurora, Cloud SQL, PlanetScale, Azure, on-premise)
- Database list (excluding system databases)
- Table metadata: row counts, data size, index size, storage engine, collation, row format
- Column details: data types, nullability, defaults, auto-increment, generated columns
- Indexes: type (BTREE, HASH, FULLTEXT, SPATIAL), uniqueness, cardinality, prefix lengths
- Views: definitions, updatability, definer, security type
- Stored procedures and functions: return types, definer, deterministic flag
- Triggers: events, timing, action statements
- Foreign key constraints with referential actions (CASCADE, SET NULL, etc.)
- CHECK constraints (MySQL 8.0.16+)
- Partitioning details: method, expression, partition sizes
- Per-database aggregates: object counts, storage engine distribution, index types, column types
- Global status counter deltas (per-second and per-day rates)
- Process list summary by command, user, host, database, and state
- InnoDB lock counters and current lock waits
- Deadlock detection from InnoDB status
- Replica status (supports both modern
SHOW REPLICA STATUSand legacySHOW SLAVE STATUS) - Binary log inventory and current position
- Binary log retention settings
- Binary log format (ROW, STATEMENT, MIXED)
- Aggregate user counts (total users, accounts without passwords, wildcard host accounts, locked accounts)
- Authentication plugin distribution (mysql_native_password, caching_sha2_password, etc.)
- SSL/TLS status (availability, required transport, TLS versions, users requiring SSL)
- Privilege summary (counts of users with broad privileges, SUPER, replication grants, database-level grants)
- Password validation policy settings
No individual usernames or specific grant details are collected.
- Full-text indexing usage
- Geospatial data types
- Foreign key constraints
- Table partitioning
- InnoDB compression
- SSL/TLS configuration
- Explicit table locking patterns
- XA transactions
- Prepared statements
- Galera Cluster (wsrep) detection
- Table contents or row data
- Query text or slow query log entries
- User passwords or authentication credentials
- Connection strings or URIs
- Application code or business logic
- Billing or account information
Leave the database field empty to discover every database the user can access:
engine: mysql
mysql:
host: db.example.com
port: 3306
database: ""
username: planetscale_discovery
password: your_passwordSet the database field to focus on one database:
engine: mysql
mysql:
host: db.example.com
port: 3306
database: my_application_db
username: planetscale_discovery
password: your_passwordThe schema analysis and the schema-based feature checks then cover that database alone. Server configuration, status counters, the process list, replication and user accounts belong to the whole server, so they still describe the whole server.
engine: mysql
mysql:
host: db.example.com
port: 3306
username: planetscale_discovery
password: your_password
providers:
aws:
enabled: true
regions:
- us-east-1
output:
output_dir: ./mysql_discovery_outputRun with (the engine and modules come from the config):
ps-discovery --config combined-config.yamlRun only the analyzers relevant to your assessment:
# Schema and features only
ps-discovery database --engine mysql --host db.example.com -u root -W \
--analyzers schema,features
# Performance and replication only
ps-discovery database --engine mysql --host db.example.com -u root -W \
--analyzers performance,replicationAvailable MySQL analyzers: config, schema, performance, replication, security, features
Problem: MySQL dependencies are not installed.
Solution:
pip install "ps-discovery[mysql]"
# Or re-run setup.sh and select MySQL when promptedProblem: Cannot reach the MySQL server.
Solution:
- Verify the host and port are correct
- Check that the MySQL server is running and accepting connections
- Verify firewall rules allow connections from your machine
- For cloud databases, ensure the IP allowlist includes your address
Problem: Authentication failed.
Solution:
- Verify the username and password are correct
- Check that the user has the required grants (see Required Privileges)
- For PlanetScale, verify the branch credentials are active
Problem: Some analysis modules report errors or missing data.
Solution:
- Check the
analysis_gapssection of the JSON report for specific details - Ensure the user has
PROCESSandREPLICATION CLIENTprivileges - Some managed services restrict access to certain system tables — the tool reports these as gaps and continues with available data
Problem: Schema analysis seems slow or incomplete.
Solution:
- PlanetScale uses scoped
information_schema. The tool detects this and iterates per-database, which takes longer with many databases. - Verify your branch credentials have access to the databases you want to analyze.
- Some Vitess features (e.g., stored procedures, triggers) may not be available — the tool reports these as gaps.
For issues with the discovery tool:
- Report bugs: https://github.com/planetscale/ps-discovery/issues
- Documentation: See main README.md
For MySQL or PlanetScale-specific questions:
- PlanetScale Documentation: https://planetscale.com/docs
- MySQL Documentation: https://dev.mysql.com/doc/