This topic describes several different ways you can access and administer your Cloud Platform application’s Drupal database. For most of these tools, you will need the connection details and credentials for the database. See Viewing database information for information about where to find these.
Desktop applications
You can access and administer your application’s Drupal database using a desktop application that supports SSH tunneling. It specifies that you are connecting to the database through an SSH connection, using the same private key authentication that you use to SSH to the infrastructure. Here are some options to consider:
- MySQL Workbench: MySQL Workbench is a free, cross-platform, visual database design tool developed by MySQL. It runs on Windows, macOS, and Linux.
- Cloud Next: MySQL Workbench is not fully compatible with Acquia Cloud Next. As a temporary workaround, subscribers who want to resolve software connection issues with Cloud Next environments can:
- Locate the database credentials on your Databases page.
In a local terminal, run:
ssh -L $LOCAL_PORT:$DB_HOST:3306 $SSH_STRING
Here,
LOCAL_PORT
is the port to which Workbench must connect when using localhost.DB_HOST
is the hostname obtained from the Cloud Platform user interface.SSH_STRING
is the full connection string from the Cloud Platform user interface. For example,user@something
.
- Cloud Next: MySQL Workbench is not fully compatible with Acquia Cloud Next. As a temporary workaround, subscribers who want to resolve software connection issues with Cloud Next environments can:
- Navicat for MySQL: A well-designed and popular commercial tool that runs on Windows, macOS, and Linux. This software isn’t tested to verify compatibility with Cloud Next environments.
phpMyAdmin
Acquia does not recommend you to use phpMyAdmin on Cloud Platform. This software can expose your application to unnecessary risk, especially if the software is not up-to-date. phpMyAdmin is not officially supported on Cloud Next, and subscribers can leverage alternative solutions.
Command line
You can also access your database over SSH and use MySQL’s command line. For more information, see Accessing your database from the command line.
Database tasks
You can use database management tools to perform the following tasks:
- Rename, import, export, and otherwise manage databases and database tables directly in your web browser.
- Export data in a range of formats, including CSV, Excel, XML, and OpenOffice.
- Browse or search in your data.
- Edit fields in your databases directly.
- Import and export database snapshots for given releases in your development workflow.
- Support your organization’s policies on data backup and archiving.
- Test database queries during module development and debugging.
You can’t use database tools to create new databases in Cloud Platform. If you need a new database, use the Databases page in the Cloud Platform interface, or the POST /applications/{applicationUuid}/databases Cloud Platform API endpoint. For an example implementation, download this example database creation script
.
Using database tools on Cloud Platform Enterprise
If you have a Cloud Platform Enterprise application running on the Cloud Classic infrastructure, it includes a highly available database cluster, using bi-directional replication between database pairs. Each database has an active and inactive infrastructure. If you run intensive processes, such as database backups, against the active infrastructure of a live application, it can impair the performance of your production website. Tools in Cloud Platform, such as its user interface and the API, run against the inactive database infrastructure to avoid this performance impact. However, some other database tools run against the active database infrastructure. For example, running the mysqldump
or drush sql-sync
command from the command line. Therefore, you should use the Cloud Platform database tools for larger operations, such as database dumps. For example, if you want to create a database backup from the command line, you can use a Drush Cloud command similar to the following:
drush @[site].[env] ac-database-instance-backup [db name]
substituting your own website, environment, and database names. The database backup will run against the inactive database, avoiding any performance impact on your active database.
For environments running on Cloud Next, the preceding command is not available. Therefore, you must use Acquia CLI, Acquia Cloud API v2, or the Cloud Platform user interface to create database backups.