This page describes how to connect a SQL Server client, running locally on your client machine, to your Cloud SQL instance.
Need help? For help troubleshooting the proxy, see Troubleshooting Cloud SQL Proxy connections. Or, see our Cloud SQL Support page.
Before you begin
Before you can start using a client, you must have:
-
Created a Cloud SQL instance, including configuring the default user.
See Creating Instances and Configuring the default user account.
Determined how you will connect to your instance.
- Installed the SQL Server command-line tools.
Using a local client
Using a local client to connect to your Cloud SQL instance involves three high-level tasks:
- Install the client.
- Configure access to your Cloud SQL instance.
- Connect to your Cloud SQL instance.
Install the client
To install the client:
Debian/Ubuntu
For Debian/Ubuntu, install the applicable SQL Server command-line tools using these instructions.
CentOS/RHEL
For CentOS/RHEL, install the applicable SQL Server command-line tools using these instructions.
openSUSE
For openSUSE, install the applicable SQL Server command-line tools using these instructions.
Other platforms
See the landing page for installing SQL Server, as well as the SQL Server downloads page.
Configure access to your Cloud SQL instance
To configure access to your instance:
- From the client machine, use What's my IP to see the IP address of the client machine.
- Copy that IP address.
- Go to the Cloud SQL Instances page in the Google Cloud Console.
- Click the instance to open its Overview page, and record its IP address.
- Select the Connections tab.
- Under Authorized networks, click Add network and enter the IP address of the machine where the client is installed.
- Click Done. Then click Save at the bottom of the page to save your changes.
- Connect to your instance.
Connect to your Cloud SQL instance
To connect to your instance:
- Confirm that you have installed the client and configured access to your instance.
- Use the
sqlcmd
command to connect, by following steps similar to those in the examples on the SQL Server quickstart and Use the utility pages.
To connect to your instance using SSL:
Use the instructions in the Client Initiated Encryption section, and related sections, of the Encrypting Connections to SQL Server on Linux page.
What's next
- Learn about the two levels of access control for Cloud SQL instances.
- Create users and databases.
- Learn about configuring an instance with a private IP address.
- Learn more about SQL Server.
- Learn about options for support.