1
votes

I want to create a gcloud SQL database from the command line. I have tried the following: gcloud beta sql instances create <name> --region us-east1 --project <project-name> --activation-policy=ALWAYS

After it's done, in the console I see a first generation SQL instance was created. Is there a way to create a 2nd generation Cloud SQL instance without entering the web console?

1

1 Answers

2
votes

Yes, you need to select a machine type tier that is for Second Gen. you can see all tiers via:

gcloud sql tiers list

Anything starting with db- is Second Gen. So for example:

gcloud beta sql instances create instance1 --tier=db-n1-standard-8

This creates a new MySQL Second Gen instanced called 'instance1' of machine type N1 Standard 8.