Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I connect to Google Cloud SQL from Google Compute Engine?

I am building a Django site on Google Compute Engine, and I want to install my database in SQL Cloud. It is possible?

What is the most common way to do this? Installing MySQL on virtual machine or use a Cloud SQL instance?

Thank you.

like image 393
Allan Porras Avatar asked Oct 15 '25 07:10

Allan Porras


1 Answers

You can use either Google Cloud SQL or manage your own SQL database, depending on your needs.

To use Cloud SQL, you'd want to follow the instructions here: https://developers.google.com/cloud-sql/docs/external

If you want to manage your own SQL database, you can install MySQL or some other database on an instance. Depending on your needs, you can start with a g1-small with a fairly large disk attached and then later use a larger instance type to run your database.

If you're running your own database, you'll need to make sure to take regular backups and copy them off the database machine, to someplace like Google Cloud Storage. If you're using Cloud SQL, you can use the console or the API to schedule database backups.

like image 77
E. Anderson Avatar answered Oct 19 '25 14:10

E. Anderson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!