Hi, im currently working on a project but i dont know really well how to use google cloud shell, so my question is: How do you create and populate tables with a mysql DB? I hope you can help me thanks.
In your Cloud SQL instance page, click IMPORT. From there you can browse to a file that you have previously uploaded to Cloud Storage. The file can be a CSV file or an SQL dump file that you have exported from another database.
Do not follow the tutorial in this video. I was following this video as a practice and paid a lot of money. I didn't know this was going to cost money (thought it would not be charged for a very small test scale) I connected to gcp phone,email support but They always just told me to delete the project (How do I delete a service that is already running with Firestore?) Maybe it was because the support team didn't know anything about development. I finally found a way to disable cloud sql on the gcp console api resource side all by myself. And finally I was able to stop charging. Beginners can get lost, so be careful. If you don't have supporters to help you
Private IPs (aka, VPCs) require a little bit of extra configuration that is documented here: cloud.google.com/sql/docs/mysql/private-ip; and if you're connecting via the Cloud SQL Proxy, then you have to enable the Admin API in the project that hosts the Service Account you're using to connect.
I tried this with a cloud run but I cant connect to the CloudSQL MySQL server unless I allow 0.0.0.0/0. Is there another solution to this with Cloud Run and CloudSQL on public IP?
In general, I recommend avoiding IP addresses and instead adding the correct Cloud SQL instance as an official connection in the Connections tab on your Cloud Run instance (under Deploy a new Revision), and then from within code, connecting via the running Cloud SQL Connector that Cloud Run supplies. You've tried this and it didn't work? If so, what error are you getting?
Thanks a lot for the great video! I have a little question and a remark, for the question, how would the code change if I'm using a MySQL Database? I mean, for the sqlalchemy drivername part. And the remark is that, in the description, the link is repeated for "Code for this episode" and "Cloud SQL documentation" 😅
If you're familiar with these concepts and know you need or want them, then by all means, they are a great idea. I was merely meaning to imply that for many new projects, it's better to focus on the basics and get something launched.
@@mkc11267 Cloud Run can now send data directly to a VPC, so VPC Serverless connectors are no longer needed. This reduces the cloud bill and the project complexity. Check out my video "Cloud Run to VPC, simplified" for the details!
small question about the database connection name, i can see that it has define in 3 places (.env, code as a query, cloud deply cmd). defining connection in one place would not be enough ?
I think what you are seeing is that the same connection name needs to be defined both within the Cloud Run instance and within the CloudSQL instance. The shell script is executed on the Cloud Run instance. Also, in the CloudSQL instance, it is not defined in the code query. The query get its value from the environment, because it is defined in .env.
If you don't want to deal with a Build & Deploy script, you can use a single command "gcloud beta run deploy --source=[DIRECTORY]" - cloud.google.com/blog/products/serverless/build-and-deploy-an-app-to-cloud-run-with-a-single-command
Get $300 and start running workloads for free → goo.gle/30Zg36Y
Love these Martin, enjoy the different guest per episode. Would be great to see an episode on Cloud Run + Secrets Manager
That's a great idea, Brian. Thank you!
We now have video for integrating Cloud Run and Secret Manager: th-cam.com/video/JIE89dneaGo/w-d-xo.html. Thank you suggesting this topic!
You guys rock. I'm either voting for tabs or space, however I'm sure voting for more videos like this 🙂
Thanks, Sunny, much appreciated!
Would love to see this using Firestore and the extension to sync data to bigquery then using the new materialized views for dashboard / reports.
Yeah bigquery, especially with new materialized views, came to mind when they described the use case to me as well.
Hi, im currently working on a project but i dont know really well how to use google cloud shell, so my question is: How do you create and populate tables with a mysql DB? I hope you can help me thanks.
In your Cloud SQL instance page, click IMPORT. From there you can browse to a file that you have previously uploaded to Cloud Storage. The file can be a CSV file or an SQL dump file that you have exported from another database.
@@MartinOmander okay 👍🏻, thank you.
Would be great to see the private IP configuration
Do not follow the tutorial in this video. I was following this video as a practice and paid a lot of money. I didn't know this was going to cost money (thought it would not be charged for a very small test scale) I connected to gcp phone,email support but They always just told me to delete the project (How do I delete a service that is already running with Firestore?) Maybe it was because the support team didn't know anything about development. I finally found a way to disable cloud sql on the gcp console api resource side all by myself. And finally I was able to stop charging. Beginners can get lost, so be careful. If you don't have supporters to help you
What happens if my SQL server is in a different project?
Private IPs (aka, VPCs) require a little bit of extra configuration that is documented here: cloud.google.com/sql/docs/mysql/private-ip; and if you're connecting via the Cloud SQL Proxy, then you have to enable the Admin API in the project that hosts the Service Account you're using to connect.
I tried this with a cloud run but I cant connect to the CloudSQL MySQL server unless I allow 0.0.0.0/0. Is there another solution to this with Cloud Run and CloudSQL on public IP?
In general, I recommend avoiding IP addresses and instead adding the correct Cloud SQL instance as an official connection in the Connections tab on your Cloud Run instance (under Deploy a new Revision), and then from within code, connecting via the running Cloud SQL Connector that Cloud Run supplies.
You've tried this and it didn't work? If so, what error are you getting?
Thanks a lot for the great video! I have a little question and a remark, for the question, how would the code change if I'm using a MySQL Database? I mean, for the sqlalchemy drivername part. And the remark is that, in the description, the link is repeated for "Code for this episode" and "Cloud SQL documentation" 😅
what about C# connection string ?
why not use vpc serverless connector and private vpc to reach de cloud sql instance?
If you're familiar with these concepts and know you need or want them, then by all means, they are a great idea. I was merely meaning to imply that for many new projects, it's better to focus on the basics and get something launched.
saw vpc servless connector today after 3 years. It costs a lot of money
@@mkc11267 Cloud Run can now send data directly to a VPC, so VPC Serverless connectors are no longer needed. This reduces the cloud bill and the project complexity. Check out my video "Cloud Run to VPC, simplified" for the details!
small question about the database connection name, i can see that it has define in 3 places (.env, code as a query, cloud deply cmd).
defining connection in one place would not be enough ?
I think what you are seeing is that the same connection name needs to be defined both within the Cloud Run instance and within the CloudSQL instance. The shell script is executed on the Cloud Run instance. Also, in the CloudSQL instance, it is not defined in the code query. The query get its value from the environment, because it is defined in .env.
Please add video with nodejs code too for postgresql to connect and query :) .. thanks!!
Could you point us to the load testing part video? Thanks a lot!
The load testing video is here: th-cam.com/video/r9qvB-JH4jM/w-d-xo.html
What happen with the old serverless videos where you use nodejs as an example?
Nothing wrong with changing it up. We have code examples for both now. :)
@@KevinBoutin where could we find them?
@@megairrational on this youtube channel.
Gosh, y'all so smart
If you don't want to deal with a Build & Deploy script, you can use a single command "gcloud beta run deploy --source=[DIRECTORY]" - cloud.google.com/blog/products/serverless/build-and-deploy-an-app-to-cloud-run-with-a-single-command
Thank you for adding this, Brian!
Please please help me
Something very creepy about the dialogue here. The curated responses are ...not human like.