1

I am having a hard time setting up a database in Google Cloud SQL. As of right now I have database created with a table for "Students". What I don't understand is how to view the data and/or how to import data from an API into this database.

I've tried fetching all the data from an API and using INSERT in a data.sql file, but this has proven to be immensely slow and inefficient

I expect that there is a way to directly gather API data and insert it into the cloud database, but I have not found a way to do this yet.

3
  • Payton, watch one of the Cloud SQL or just plain MySQL videos on YouTube to get an understanding of the basics of SQL databases. Commented Jul 23, 2019 at 21:30
  • Hi, i need little more information about your setup. Are you using MySQL or PostgreSQL? Also wich API are you using? You could be using the REST API, the GCloud API. Commented Jul 24, 2019 at 10:07
  • I'm using MySQL and a REST API Commented Jul 24, 2019 at 14:47

1 Answer 1

1

To view the data in your database you can ssh into your Cloud SQL instance following this Quickstart for Cloud SQL for MySQL guide. To select your database when you reach this point in the guide Just use the command USE <Your database name>; to select the database that you already created. Then you can do a SELECT * FROM <yourTable>; to see your data.

After that in order to use the Cloud SQL REST API to import data into your database, you can follow this Importing data into Cloud SQL guide. Here you will be able to import your data.sql from a bucket (which is the fastest way to import data into your database).

To export data from your database you can also follow this Exporting data from Cloud SQL guide.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.