Fully managed, highly available relational databases.
Create, configure, and use MySQL databases that live in
Google's Cloud. We manage replication, encryption, patch management,
and backups, so you focus on your applications and services.
Easy to use, flexible configuration. Create,
configure, manage, and monitor your database instances with just a
couple of clicks in our console or using a command line tool. Manage
your instances using any applications and tools you already use with
Exceptional security and integration with Google Cloud. All data is encrypted when stored and in flight on Google's network. Connections to instances are accepted only from authorized IP addresses, and can be secured with SSL, and MySQL user grants can control access at the database, table, or even column level. All data is replicated multiple times in multiple locations for great durability and availability. Databases can be created in the United States, European Union, or Asia.
Cloud SQL is tightly integrated with Google App Engine, Compute Engine, Cloud Storage, and other Google services, so you can work across multiple products easily, get more value from your data, move your data into and out of the cloud, and get better performance.
Try it now
Create and configure a Google Cloud SQL instance
- In the left sidebar, click Storage > Cloud SQL.
- Click New Instance.
- Enter a name for the instance and click Save.
After the instance is running, select the instance, and then
click Access Control to finish configuring the
Click Request an IP Address and use this as
instance-IPin Step 3.
- In the Set Root Password box, enter a root password, and click Set.
- Click Add Authorized Network and add your IP address.
- Click Request an IP Address and use this as your
- Install the Cloud SDK.
Create an instance.
$ gcloud sql instances create
Modify the instance and grant access to your IP
$ gcloud sql instances patch YOUR_INSTANCE_NAME --authorized-networks YOUR_IP_ADDRESS
Set the root password for the instance.
$ gcloud sql instances set-root-password YOUR_INSTANCE_NAME --password-file PASSWORD_FILE
Assign an IPv4 address to the instance and retrieve it.
$ gcloud sql instances patch YOUR_INSTANCE_NAME --assign-ip $ gcloud sql instances describe YOUR_INSTANCE_NAME
In the output, find the "ipAddress" field. Use this as your
instance-IPin Step 3.
Connect to the instance
- Install the MySQL Client.
Connect to the instance.
$ mysql --host=instance-IP --user=root --password
Create a database and table, enter some data, and query the data.
CREATE DATABASE guestbook; USE guestbook; CREATE TABLE entries (guestName VARCHAR(255), content VARCHAR(255), entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID)); INSERT INTO entries (guestName, content) values ("first guest", "hello world!"); SELECT * FROM entries;
- If you do not plan on continuing to use the instance you created above, delete it to avoid incurring charges.
- Read more about the Google approach to security.
- Review the Overview page to learn more about the features of Cloud SQL.
- Try out the more in-depth Getting Started tutorial.
- Learn how to use the Google Developers Console for common tasks.