Last Reviewed: 2022-12-13
Add Database
Now that you've set up your Pantheon Dev environment, you need to import your database.
Create a .sql Dump File
The Database import requires a single .sql dump that contains the site's content and configurations.
-
Create a
.sqldump using the mysqldump utility. -
Compress the resulting archive with gzip to reduce the size for a faster transfer:
- Replace
USERNAMEwith a MySQL user with permissions to access your site's database. - Replace
PASSWORDwith the MySQL user's password. To force a password prompt, move-pto the end of the command and leave it blank. This prevents your MySQL password from being visible on your terminal. - Replace
DATABASEwith the name of your site database within MySQL. ~/db.sqldefines the output target to a file nameddb.sqlin your user's home directory. Adjust to match your desired location.
The resulting file will be named db.sql.gz You can use either the Pantheon Dashboard or a MySQL client to add your site's database.
Add Your Database to Pantheon's Platform
-
Select the Dev environment in the Site Dashboard.
-
Select Database / Files.
-
Click Import and add your archive accordingly (based on file size):