To access a database in your application using the ah-sql-cli command:
Connect to an environment of your application using SSH.
For more information, see Managing applications using the command line.
Open a connection to your database with a command similar to the following:
ah-sql-cli @[site].[env]Replace [site] with your application name and [env] with the name of the environment whose database you want to connect to (typically, dev, test, or prod, for the development, staging, and production environments, respectively).
Cloud Platform also includes the ah-sql-connect command, which is a Drush command you can also use connect to your database. The ah-sql-connect command is like drush sql-connect, except that ah-sql-connect doesn’t require a functioning Drupal website. The ah-sql-connect command takes the same options as ah-sql-cli. The output of ah-sql-connect is the MySQL command (with user name, password, and database name) which you can use to connect to your database. For example:
ah-sql-connect @[site].[env] mysql -h free-1712 -u example1dev -myverysecurepassword example1devTo review the arguments and options for the ah-sql-cli and ah-sql-connect Drush commands, see Custom Drush commands for Cloud Platform.
With the Cloud Platform API, you can create, restore, and delete backups of your application’s databases. For an example implementation, use the example database creation script.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
To access a database in your application using the ah-sql-cli command:
Connect to an environment of your application using SSH.
For more information, see Managing applications using the command line.
Open a connection to your database with a command similar to the following:
ah-sql-cli @[site].[env]Replace [site] with your application name and [env] with the name of the environment whose database you want to connect to (typically, dev, test, or prod, for the development, staging, and production environments, respectively).
Cloud Platform also includes the ah-sql-connect command, which is a Drush command you can also use connect to your database. The ah-sql-connect command is like drush sql-connect, except that ah-sql-connect doesn’t require a functioning Drupal website. The ah-sql-connect command takes the same options as ah-sql-cli. The output of ah-sql-connect is the MySQL command (with user name, password, and database name) which you can use to connect to your database. For example:
ah-sql-connect @[site].[env] mysql -h free-1712 -u example1dev -myverysecurepassword example1devTo review the arguments and options for the ah-sql-cli and ah-sql-connect Drush commands, see Custom Drush commands for Cloud Platform.
With the Cloud Platform API, you can create, restore, and delete backups of your application’s databases. For an example implementation, use the example database creation script.
If this content did not answer your questions, try searching or contacting our support team for further assistance.