Connect Google Cloud SQL to a Python Cloud Function

  Рет қаралды 8,209

Vladsave Coding

Vladsave Coding

Күн бұрын

In this video we will connect to the Google Cloud SQL database from a Cloud Function written in
Python. We will start by creating the Cloud SQL instance, then connect to it and enter some data,
then work on the function that can read this data.
Source code, commands and links used in the video:
github.com/titus58/youtube-tu...
Chapters
00:00 Introduction
00:28 Create the Cloud SQL instance
02:22 A warning on Cloud SQL pricing
05:33 Connect to Cloud SQL from localhost using cloud_sql_proxy
09:50 Create database table and enter data
12:39 Start on the Python code, install PyMySQL library
14:28 Write main.py
18:28 Passing query parameters without causing SQL injection attack
19:59 Reorganize code, prepare for Cloud Function
21:39 Create the cloud function
22:29 Give IAM permission to the App Engine service account
25:08 Investigate function failure, enable Cloud SQL Admin API
26:46 Final testing and repeated warning about cost
27:41 Outro

Пікірлер: 15
@samiullahshah7264
@samiullahshah7264 Ай бұрын
Thanks, Vladsave, your video made my task very easy.
@JelleKeppels
@JelleKeppels Жыл бұрын
Great tutorial, thanks a lot!
@How_About_This428
@How_About_This428 Жыл бұрын
Thank you very much i really appreciate people like you who spread this kind of knowledge
@vladsavecoding4111
@vladsavecoding4111 Жыл бұрын
Thank you 🙏
@mozenco
@mozenco 5 ай бұрын
Awesome tutorial 💌
@kalidsherefuddin
@kalidsherefuddin Жыл бұрын
Thanks for
@Geeksrik
@Geeksrik 3 ай бұрын
I am unable to connect to my SQL instance just following what you have provided. I see you used socket from local host but on cloud function you did not use the socket part. I get the following error pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'w.x.y.z' (timed out)") My SQL instance has a public and private IP. Should I use sockets even on the cloud, or maybe sql proxy? service account is as you ve shown with the right level of permissions.
@vladsavecoding4111
@vladsavecoding4111 3 ай бұрын
If it fails on the Cloud functions make sure you enable Cloud SQL Admin API. If the proxy fails on your local machine make sure the user you are using has permissions for Cloud SQL and you enter the password correctly. You can go to IAM in Google Web Console and give "Cloud SQL Admin" to the user you logged in with
@muniefhassantahir6806
@muniefhassantahir6806 Жыл бұрын
I want to connect to my instance in a project I have deployed on google server. I am scrapping data and I want to store the data in this instance. How do I do that? Can you spare me few minutes? I will provide my contact details.
@TrikNgonlen
@TrikNgonlen 6 ай бұрын
Do you have tutorial about deploying Laravel App + MySQL to Cloud Run + Cloud SQL?
@vladsavecoding4111
@vladsavecoding4111 6 ай бұрын
Unfortunately no, I never used Laravel. Maybe I'll do one in the future
@TrikNgonlen
@TrikNgonlen 6 ай бұрын
@@vladsavecoding4111 awesome! Can't wait for that
@discere5811
@discere5811 Жыл бұрын
are all the process the same if my machine runs on windows?
@vladsavecoding4111
@vladsavecoding4111 Жыл бұрын
Yes, you can use cloud_sql_proxy on windows
@discere5811
@discere5811 Жыл бұрын
@@vladsavecoding4111 thank you for replying, but can you make a tutorial where in you use a machine running on windows? because I somehow cannot follow this video since its on mac
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 25 МЛН
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 59 МЛН
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,3 МЛН
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 14 МЛН
Cloud Run + Cloud SQL, setup
10:53
Google Cloud Tech
Рет қаралды 30 М.
Database Configurations with Google Cloud SQL
16:47
Google Cloud Tech
Рет қаралды 61 М.
Google Cloud: Connect Compute Engine (GCE) to Cloud SQL (3 ways)
24:13
Vladsave Coding
Рет қаралды 1,9 М.
SQLAlchemy: The BEST SQL Database Library in Python
16:39
ArjanCodes
Рет қаралды 52 М.
Dockerize Python script and deploy to Google Compute Engine (GCE)
14:24
Automate Python script execution on GCP
14:14
Cloud 4 Data Science
Рет қаралды 20 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 25 МЛН