Importing Data Into AppFog v2 MySQL

Updated by Ben Heisel on Feb 8, 2016


This document is for users of AppFog v1 for migration to the next generation of AppFog that is located in CenturyLink Cloud Control Portal.

Before deleting any applications or services on AppFog v1 ensure you have local copies. Once apps and services are deleted it is permanent. We will not be able to provide a backup.

When migration is complete your billing subscription can be canceled from the Account page of the web console. Please be sure to cancel your subscription as we are not aware when individual user migration is complete. The billing system will not automatically prorate the subscription and issue a refund. If applicable, please open a Support Ticket or email [email protected] to receive a prorated refund of your subscription.

Importing Data Into CenturyLink MySQL Relational DB Service

  • To learn how to create, bind, and determine connection credentials review our Knowledge Base article on Using CenturyLink MySQL with AppFog Applications.
  • You can access your database from the command line or a third-party tool using the credentials provided by the VCAP_SERVICES environment variable. The VCAP_SERVICES variable can be viewed using cf env <APP_NAME> from the CLI, or by navigating to your application in the web control portal by selecting the AppFog icon, choosing the application, then selecting Environment. You can also Connect to MySQL Relational DB over SSL on AppFogv2. The certificate needs to be in proper .pem format:

Example VCAP_SERVICES environment variables:

$ cf env myapp
  "ctl_mysql": [
    "credentials": {
     "certificate": "-----BEGIN CERTIFICATE-----\n{...}\n-----END CERTIFICATE-----",
     "dbname": "default",
     "host": "<HOST_ADDRESS>",
     "password": "<PASSWORD>",
     "port": <PORT_NUMBER>,
     "username": "admin"
    "label": "ctl_mysql",
    "name": "example-db",
    "plan": "small",
    "tags": []

Example Connection:

  mysql -h <HOST_ADDRESS> -u admin -p -P <PORT_NUMBER>
  • At the prompt enter the password <PASSWORD>.
  • To import a MySQL dump file the the default database:

    mysql -h <HOST_ADDRESS> default -u admin -p --ssl-ca=/path/to/file/ca-cert.pem -P <PORT_NUMBER> < /path/to/file/db_dump.sql

Customer Support

Can’t find what you need?
Give us a call.


M – F, 8am to 6pm