Overview
This guide covers common issues you might run into when importing a database to PlanetScale and how to fix them. Most problems show up when you create the external keyspace. Runpscale keyspace create-external with --dry-run to check your source database without creating anything. Connection, server configuration, and user grant errors stop the external keyspace from being created. Schema errors are listed for each table but don’t block creation.
Connection issues
Can’t connect to external database
If PlanetScale can’t connect to your database, here’s what to check: Verify your credentials locally Try connecting with the same credentials using the MySQL CLI:- Your database has a public IP address
- Public access is enabled in your database settings
- No VPN or private network is required
- Try
--ssl-mode disabledto test if SSL is the issue - If your database uses self-signed certificates, provide the full CA certificate chain
- For managed databases (RDS, Azure, etc.), use
--ssl-mode requiredor--ssl-mode verify_ca
Connection times out
If the connection attempt times out: Firewall rules Most timeouts are caused by firewall rules blocking PlanetScale IPs. Double-check:- All IPs for your region are allowlisted
- The port (usually 3306) is open
- Any cloud provider security groups are configured correctly
- Use the cluster endpoint, not individual instance endpoints
- Default MySQL port is 3306, but some providers use different ports (DigitalOcean uses 25060)
Server configuration errors
GTID mode is OFF
Error:external database settings are not compatible with PlanetScale: "gtid_mode" must be "ON", but found: "OFF"
Solution:
You need to enable GTID mode in your database configuration.
For AWS RDS/Aurora:
- Create a custom DB parameter group
- Set
gtid-modetoON - Set
enforce_gtid_consistencytoON - Apply the parameter group to your database
- Reboot the database
- Go to Server parameters
- Set
gtid_modetoON(you may need to go through intermediate states:OFF_PERMISSIVE→ON_PERMISSIVE→ON) - Set
enforce_gtid_consistencytoON - Save changes
my.cnf or my.ini:
Binary logging not enabled
Error:external database settings are not compatible with PlanetScale: "log_bin" must be "ON", but found: "OFF"
Solution:
For AWS RDS/Aurora:
Binary logging is tied to automated backups. Enable automated backups with a retention period >= 2 days.
For GCP Cloud SQL:
Enable Point in Time Recovery (PITR) from the console.
For self-hosted:
Add to your configuration:
Wrong binlog format
Error:"binlog_format" must be "ROW", but found: "MIXED" or "STATEMENT"
Solution:
Set binlog_format to ROW in your database configuration, then restart.
If you see "binlog_row_image" must be "FULL" or "NOBLOB", set binlog_row_image to FULL.
For managed databases, update this in your parameter group or server parameters.
Binlog retention too short
Error:"binlog_expire_logs_seconds" must be > 172800 (or similar for expire_logs_days). On AWS RDS and Aurora: "binlog retention hours" must be at least 48 hours or binlog retention is not set on this AWS RDS database.
Solution:
You need at least 48 hours of binlog retention for the import to work.
For AWS RDS/Aurora:
sql_mode is not compatible
Error:"sql_mode" cannot have "ANSI_QUOTES" enabled or PlanetScale requires "sql_mode" to have the following options set: "NO_ZERO_IN_DATE, NO_ZERO_DATE"
Solution:
Remove ANSI_QUOTES from sql_mode, and make sure it includes NO_ZERO_IN_DATE and NO_ZERO_DATE. For managed databases, update this in your parameter group or server parameters.
max_connections is too low
Error:PlanetScale requires external databases to support at least a max connection limit of 10
Solution:
Set max_connections to at least 10. PlanetScale uses up to half of your max_connections for the import.
Unsupported MySQL version
Error:unsupported MySQL version detected
Solution:
MySQL 5.6, 5.7, and 8.0 are supported. Contact support if you need to import from a different version.
Existing _vt database
Error: external database may have existing Vitess state: found "_vt" Vitess state database
Solution:
Your source database already has a _vt database, usually left behind by an earlier Vitess-based import or replication tool. Make sure nothing is using it, then drop it and try again:
Schema compatibility issues
No unique key on table
Error: Table has no unique key Solution: All tables must have a unique, not-null key. This is required for replication to work correctly. Add a primary key or unique index to the table:Invalid charset
Error: Table uses unsupported charset Solution: PlanetScale supports:utf8, utf8mb4, utf8mb3, latin1, and ascii.
Convert your table to a supported charset:
utf8mb4 as it has the widest character support.
Table names with special characters
Error: Table name contains unsupported characters Solution: Rename tables that have characters outside the standard ASCII set:Views detected
Views aren’t imported automatically. After your import completes, you’ll need to manually recreate any views in your PlanetScale database.Unsupported storage engine
Error: Table uses non-InnoDB storage engine Solution: Convert your tables to InnoDB:Foreign key import issues
Import slower than expected
Foreign key imports use an atomic copy (--atomic-copy), which holds a long-running transaction on your source database. This can be slow on large databases.
Solution:
Run the import during off-peak hours, and make sure your source database has enough CPU and I/O headroom for the copy.
Import failed and won’t resume
Unlike regular imports, foreign key imports must start from the beginning if they fail. Solution: Before retrying:- Fix any errors that caused the failure
- Make sure your binlog retention is long enough for the full import
- Consider importing during off-peak hours
--keep-data=false and create it again.
Can’t select specific tables
When your database has foreign keys, import every table with--all-tables to maintain referential integrity.
If you really only need specific tables, you’ll need to:
- Remove foreign key constraints from your source database
- Import only the tables you need
- Recreate foreign key constraints in PlanetScale after import
Schema errors when creating the external keyspace
External keyspace created with schema errors
Schema errors, such as a table without a unique key, are listed for each table but don’t stop the external keyspace from being created. Tables with schema errors will fail to import. Solution:- Fix the tables on your source database, then run
create-external --dry-runagain to confirm, or - Leave those tables out of the import with
--exclude-tableswhen you create the MoveTables workflow
Import monitoring issues
Replication lag is high
During the initial copy phase, high replication lag is normal. The lag should drop once the copy finishes. If lag stays high after copy completes:- Check source database load - High write activity on source can cause lag
- Slow queries - Look for slow queries or locks on the source database
- Network issues - Check for network latency between source and PlanetScale
- Large transactions - Very large transactions take time to replicate
- Reduce write load on source during import
- Wait for off-peak hours
- Check binlog retention isn’t expiring before lag catches up
Workflow stopped after a schema change
With the default--on-ddl STOP, the workflow stops when a schema change runs on your source database. The stream’s message starts with Stopped at DDL.
Solution:
Review the schema change, apply it to your PlanetScale database if needed, then resume the workflow with pscale branch vtctl move-tables start.
Streams show errors
Check themessage on each stream in the status output, or the Streams panel on the workflow page in the dashboard. Common ones:
“Access denied” - Permission issues. See user requirements.
“Table doesn’t exist” - Schema may have changed during import. Don’t modify schema during import.
“Deadlock found” - Usually temporary. The import will retry.
Connection lost - Network issue or source database restarted. The import will retry.
Import stuck in “Copying” phase
The copy phase can take a while for large databases. Check:- Check
table_copy_statein thestatusoutput, or the Tables panel on the workflow page, to see if it’s actually stuck or just slow - Check the stream messages for any errors
- Verify source database is responding
- Check source database for locks or slow queries
- Verify network connectivity
- Look for errors in the stream messages
Permission errors
MySQL error 1045: Access denied
Error:Access denied for user 'migration_user'@'%'
Solution:
Check that your migration user has all required permissions. See our import user permissions.
For foreign key imports, the user needs either:
FLUSH_TABLESorRELOADprivileges (preferred)LOCK TABLESprivilege (minimum)
Required grants are missing
Error:external database does not have the required user grants: required privileges [...] are not present
Solution:
Grant the privileges listed in the error. They must be granted directly to the user at the global or database level. See Import user permissions.
If the error says the permissions do not match user, the user was created for a specific host. Create it for the host '%' instead.
Can’t create the ps_import database
Solution: Grant the migration user permissions on the database PlanetScale creates to track replication:Traffic switching issues
Can’t switch replica traffic
Make sure:- Replication lag is low (under a few seconds).
switch-trafficfails if lag is above--max-replication-lag-allowed - Every stream is
Running - No stream shows an error
Can’t switch primary traffic
Make sure:- Your application is connected to PlanetScale
- Replication lag is minimal
- Every stream is
Running
Data inconsistency after switching
If you notice missing or stale data after switching traffic:- Check replication lag - it may still be catching up
- Verify your application is actually connecting to PlanetScale
- Run a VDiff to compare your source database with PlanetScale
Completing the import
Complete fails with keep_data must be true
Error: keep_data must be true when the source keyspace is external
Solution:
Completing an import never removes tables from your source database. Pass --keep-data=true, with an =, and leave out --rename-tables.
Common provider-specific issues
AWS RDS
Problem: Can’t modify GTID settings on default parameter group Solution: Create a custom DB parameter group with your MySQL version, modify settings there, then apply to your database. Problem: Binary logs not enabled Solution: Enable automated backups with retention >= 2 days.Azure
Problem: Can’t set gtid_mode directly to ON Solution: Change through intermediate states:OFF_PERMISSIVE → ON_PERMISSIVE → ON
DigitalOcean
Problem: ANSI_QUOTES mode enabled Solution: Remove ANSI_QUOTES from Global SQL mode in Settings. Problem: Binlog retention too short Solution: Set Binlog Retention Period to at least 172800 seconds (48 hours).GCP Cloud SQL
Problem: Binary logging disabled Solution: Enable Point in Time Recovery (PITR) from the GCP console.Still stuck?
If you’ve tried the solutions above and are still having issues:- Check your database’s error logs
- Review our general MySQL compatibility guide
- Look at the specific provider guide for your database
- Check the
statusoutput or the workflow page in the dashboard for detailed error messages - Contact PlanetScale support

