This document explains how to import data into your database.
The steps in this document may be too slow for large databases. If you want to import a large database, contact us at support@planetscale.com.
Before you import data into your database, you must first create a database. If you want your database to use multiple shards, apply your sharding scheme before importing data.
To import data into your database, complete the following steps:
Using your MySQL client, export your source database to a file. For example,
you can use the mysqldump
command to export your database to a file in .sql format:
shell> mysqldump --source-database > exported-database.sql
Using your MySQL client, import your database file. For example, you can use the mysql
command with the database file as an input:
shell> mysql < exported-database.sql