Google Cloud Platform
Cloud SQL

Connecting from External Applications

Applications not running on Google App Engine can connect to Google Cloud SQL using the standard MySQL protocol. The steps are:

  1. Authorize the IP or range of IPs from which you will be connecting.

    You must be able to identify a range of IP addresses that you will be connecting from and authorize access for requests from these IP addresses. For an application running on Google Compute Engine, this will be the public IP address of the instance.

  2. Connect.

    After you have authorized access, you are ready to connect from MySQL client or any other Admin and Reporting Tools that support MySQL. If you are connecting programmatically, you can use any of the MySQL Connectors that provide standard database driver connectivity. To learn more about connection limits, see the FAQs Are there any size or QPS limits? and How should I manage connections?

For any connection method you choose, you must specify the IP address of the Cloud SQL instance you are connecting to, and MySQL account information (user name and password). Optionally, you can specify an initial database to connect to, and certificates and keys to use for a secure connection over SSL. For instructions on creating a secure connection, see Configuring SSL for an Instance.