Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Can I run an sql file on my Google Cloud Sql instance using the gcloud sql command

I have an sql file that creates my mysql database and all my users and tables.

I am trying to figure out of there is a way I can automate using this sql file to initialize the database on my Google Cloud sql instance.

So far, the only way I have been able to determine, is that I use the gcloud sql connect command, and then just copy and paste the contents of the sql file into the mysql prompt.

There has got to be a better way though. Looking through the gcloud sql docs, I have not been able to find one. Am I missing something?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

gcloud sql is oriented towards managing the Cloud SQL instance.

Once you've created an instance, you may use any regular MySQL tool to interact with the instance including creating tables.

For example, see: https://cloud.google.com/sql/docs/mysql/connect-admin-proxy

I encourage you to use Google's Cloud SQL proxy to connect to the remote instance, see: https://cloud.google.com/sql/docs/mysql/quickstart-proxy-test

over 4 years ago · Santiago Trujillo Report

0

Steps to run an sql file on my Google Cloud Sql instance using the gcloud sql console are as follows:

  1. Create a GCP storage bucket (ideally in the same project)
  2. Upload the file to this bucket
  3. Import the sql file from this bucket in the overview section of the GCP SQL console

There is a comprehensive set of instructions here: virginia uni GCP DB setup

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!