AASTHA BHARDWAJ: Welcome.
My name is Aastha, and I'm an engineer on the Cloud SQL team.
In this video, I'll show you how to create, run, and manage
SQL instances using Google Cloud SQL.
Cloud SQL helps manage mundane administrative tasks
for MySQL and Postgres databases so you
can focus on what matters.
Let's walk through how to create a MySQL database on Cloud SQL
and connect to it from the Google Cloud shell.
You can set up an instance in just a few steps.
Let's go through the basics, and I'll
point out some options for additional configuration
along the way.
We'll start by navigating to Cloud SQL in the GCP console
and clicking Create Instance.
And then next, choose a second generation MySQL database
engine.
Second generation instances provide better performance
and improve management tools, like automatic storage
increase.
I'll name the instance and then set the password
for our default account.
This instance will be created in the US,
and we'll leave the zone set to Any
so Cloud SQL can choose for us.
Let's take a look at configuration options.
You can specify MySQL version, instant size,
high availability, and more.
For this demo, I'll choose a four core,
high-memory instance.
Maximizing memory is a good choice for MySQL
because it can take advantage of the extra memory
for performance.
That said, don't worry too much about initial sizing.
You can scale the instance up or down later.
Let's increase the storage capacity to 200 gigabytes,
because increasing disk capacity also increases performance.
Check out the performance calculator below.
As I add capacity, my disk performance
increases, which will allow my database
to process more operations per second.
And I'll enable Automatic Storage
Increase so that I don't accidentally
run out of disk space.
Lastly, let's ensure that the database will automatically
provide isolation from failures.
We can do that by enabling the high availability
configuration, which, for MySQL, adds a failover
replica in another zone.
Now that we're happy with the configuration of our instance,
let's kick off the creation.
It may take a few minutes for your instance to create.
This is a great time to grab a quick cup of coffee.
You can also check the status of your instance
by navigating to your Instance List.
Once you see a green check mark, your instance is ready.
Looks like our instance has finished creating.
Let's open the Details page to continue.
There are many ways to connect to this instance.
Within GCP, for example, we could use App Engine, Compute
Engine, or Container Engine.
But we could also connect from just about anywhere
by authorizing IP addresses or using the Cloud SQL proxy.
For this demo, I'll connect using the Google Cloud Shell.
Cloud Shell provides command line access
to all of your Cloud resources, such as Cloud SQL instances
directly from the browser.
To open the Cloud Shell, click Connect Using Cloud Shell.
As you can see, the relevant Gcloud command
to connect to your Cloud SQL instance
has been pre-typed for us.
So all we have to do is press Enter.
And then, enter our root password from before.
And now, we're connected.
So let's create and insert some data.
To begin, I'll create a database.
Next, I'll insert some data.
Finally, I'll make sure the data is now in our database.
And it is.
Great.
So to recap, in the last few minutes,
we just created a Cloud SQL instance
with high performance and high availability,
and connected to it with Cloud Shell.
Now that you've seen how to get started, give it a try.
You can learn more about Google Cloud SQL in our free trial
program here.
Thank you for watching.