Skip to content

MySQL compatibility

Learn what MySQL syntax, functions, and more are supported by PlanetScale

Overview

PlanetScale is built on top of open-source Vitess, a database clustering system for horizontal scaling of MySQL. Consequently, PlanetScale is only compatible with MySQL databases.

If you're importing an existing database, PlanetScale supports MySQL database versions 5.7 through 8.0.

New PlanetScale databases are created on MySQL 8 with character set utf8mb4_0900_ai_ci. PlanetScale only supports utf8, utf8mb4, and utf8mb3 character sets.

MySQL compatibility limitations

The following reference guide will cover some MySQL syntax, features, and more that PlanetScale either does not support or has limitations around. We are actively working on driving up compatibility, but it's an ongoing effort and will take some time to complete. See this project board on GitHub to learn what the Vitess team is currently focusing on.

If you're attempting to import a database using our Import tool, there are some additional requirements that you can find in our Database imports documentation.

Queries, functions, syntax, data types, and SQL modes

❗ = Limitations in support
✖️ = Not supported

StatementSupportDescription
CONSTRAINT...FOREIGN KEY✖️The usage of foreign key constraints or FOREIGN KEY syntax is not supported on PlanetScale.
ALTER TABLE...RENAME COLUMN✖️Renaming columns and tables may be destructive. See our guide for column rename recommendations.
CREATE DATABASE✖️You cannot CREATE a PlanetScale database from the MySQL command line, however, this is supported in the PlanetScale CLI.
DROP DATABASE✖️You cannot DROP a PlanetScale database from the MYSQL command line, however, this is supported in the PlanetScale CLI.
JSON_TABLE✖️The JSON_TABLE function is not yet supported. All other JSON SQL functions should work.
PROCEDURE✖️We do not support any form of stored routines.
FUNCTION✖️We do not support any form of stored routines.
TRIGGER✖️We do not support any form of stored routines.
EVENT✖️We do not support any form of stored routines.
LOAD DATA INFILE✖️Loading data via LOAD DATA INFILE is not supported.
KILL✖️We do not support killing queries or shards from the command line.
PIPES_AS_CONCAT✖️Enabling this SQL mode can interfere with Vitess' evalengine parsing the SQL queries so enabling it may result in incorrect or unexpected results. Please use MySQL's standard dialect instead, e.g. CONCAT().
ANSI_QUOTES✖️Enabling this SQL mode can interfere with Vitess' evalengine parsing the SQL queries so enabling it may result in incorrect or unexpected results. Please use MySQL's standard quotation instead.

Miscellaneous

ActionSupportDescription
Empty schemas✖️Databases with empty schemas are invalid. You cannot deploy a schema change to production if no tables exist.
Non-InnoDB Storage engine✖️We only support InnoDB storage engine.
No unique key✖️We require all tables have a unique, non-null key that remains unchanged during migrations.
Direct DDL✖️We do not allow Direct DDL on production branches. This includes TRUNCATE statements.
Disabled binary logsYou must have binary logs enabled if importing a database using our database importer tool. See our Import doc for more required configuration.
Large JSON documentsMySQL supports JSON documents up to 1 GB in size. However, we do not recommend to store more than a few MB in a JSON document for performance reasons.

FAQ

Postgres support

PlanetScale does not support PostgreSQL. We have worked with customers to migrate their Postgres databases to MySQL/PlanetScale. If you have questions about migrating, get in touch.

Additional assistance

If you need additional assistance or have any questions, contact the PlanetScale Support team, or join our GitHub Discussion board.

Need help?

Get help from the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on September 23, 2022
Help us improve this page
© 2022 PlanetScale Inc.