Connect GCP Cloud SQL with Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • This is Third video, but 6th lesson in the series to understand Google Cloud Platform. My attempt is to help budding marketing analysts understand and become comfortable with GCP to provide substantial values to their stakeholders.
    In this video you can learn about how to create Google Cloud SQL instance, and use Python to extract and upload data within the tables of Cloud SQL.
    In case you want to learn about GCP right from the start, please do follow the links below:
    Session 1 - Introduction to GCP : • GCP Intro Session 1
    Session 2 - Options to store data within GCP : lnkd.in/eQ56DS9
    Session 3 - Google Cloud Storage Intro : bit.ly/2Kc2Umb
    Session 4 - Connecting Google Cloud Storage with Python: • GCP session: Google Cl...
    Session 5: Google Cloud SQL Intro: bit.ly/3lNJocE
    Code and data file used can be downloaded from the Github:
    github.com/kunalkmehta/Random...

ความคิดเห็น • 37

  • @user-kp7er1tc2w
    @user-kp7er1tc2w ปีที่แล้ว

    Super helpful! Thank you! As others have suggested, a similar overview using postgres would be great, but this was perfect! Thanks so much!

  • @faisalee
    @faisalee 2 ปีที่แล้ว

    This was amazing! Exactly what I wanted :)

  • @kaushiksanghani9205
    @kaushiksanghani9205 2 ปีที่แล้ว

    Really Great video. Thank you so much for uploading

  • @bolluvaagdevi7492
    @bolluvaagdevi7492 2 ปีที่แล้ว

    Can i get the cloud function code to load csv file from gcs bucket to mysql database table

  • @silvypl7122
    @silvypl7122 หลายเดือนก่อน

    Hi Sir, is it possible to connect spanner database in gcp with robotframework?

  • @monishn.p9574
    @monishn.p9574 ปีที่แล้ว

    I have my data in cloud SQL server .
    Can use federated queries ?

  • @pointhour
    @pointhour 3 ปีที่แล้ว +1

    I kunal, gread video ! Can we add cron to execute automatically grab csv inn cloudstorage and input in cloud sql ?

    • @KunalKMehta08
      @KunalKMehta08  3 ปีที่แล้ว

      Yaar, absolutely we can. I can give you a small algorithm for that. I would prefer doing it on a VM, so here it goes:
      1) On VM write a function to read a CSV from GCS, and then create a datFrame from that
      2) Create connection with Python and Cloud SQL, ensure that your database and table are defined within cloud SQL
      3) Then insert your dataframe into the cloud SQL table.
      4) Close the SQL connection
      5) If you want, you can delete the file from GCS
      6) Create a cron job to run this job et regular intervals on the VM.
      You will be able to write this code pretty easily, let me know if you face any issue, i can write the sample functions for you :)

  • @nahuelmasa4702
    @nahuelmasa4702 2 ปีที่แล้ว

    Alguien podria explicar paso a paso como conectar desde GCP dataflow a una base sqlserver y extraer datos dejandonlo en un bucket

  • @mattmaximo8716
    @mattmaximo8716 3 ปีที่แล้ว +1

    Really great video, i felt like i was back watching a college lecture. Do you have or reccomend a tutorial for doing this with PostgreSQL

    • @KunalKMehta08
      @KunalKMehta08  3 ปีที่แล้ว

      Hey Matt, I haven't really worked on Postgre, let me look into it, if I cn find some information aroung it.

    • @alvaroporter4584
      @alvaroporter4584 3 ปีที่แล้ว

      a trick: you can watch movies at kaldrostream. I've been using it for watching lots of of movies these days.

    • @jamarijulius1778
      @jamarijulius1778 3 ปีที่แล้ว

      @Alvaro Porter definitely, been using kaldroStream for months myself =)

    • @kasondario3930
      @kasondario3930 3 ปีที่แล้ว

      @Alvaro Porter Definitely, have been using kaldroStream for months myself :D

  • @luisponce-alvarez1565
    @luisponce-alvarez1565 2 ปีที่แล้ว

    is jupyter notebook running on the cloud or on your computer?? Im following the tutorial and having hard time to connect

    • @KunalKMehta08
      @KunalKMehta08  2 ปีที่แล้ว

      Hey buddy, it's running on my local system

  • @kleberbrum
    @kleberbrum 2 ปีที่แล้ว +1

    Hi, congratulations for your video. How i can do to connect in a database MS SQL Server in Cloud SQL?

    • @KunalKMehta08
      @KunalKMehta08  2 ปีที่แล้ว +1

      Hey Kleber, thank you so much for your comment and wishes. Apologies, I haven't really done that. I can try to do it, and can share the steps with you later on.

  • @AnthonyConti74
    @AnthonyConti74 2 ปีที่แล้ว +2

    Did you forget the ticket number for the customers? They are null in your updated table

    • @KunalKMehta08
      @KunalKMehta08  2 ปีที่แล้ว

      Good catch, Anthony. If you see the query 2 I executed @ 27:53 you would notice that I mistakenly didn't put the ticket num in my query. Though I am reading it, and setting up in the variable, but not putting it in my query.
      Tat's the reasons you see NULL there in the final updated table.
      Hope it helps you. Thanks a lot for point this out :)

  • @speedback
    @speedback 2 ปีที่แล้ว

    amazing...

  • @mirhammal3489
    @mirhammal3489 3 ปีที่แล้ว

    Can you tell me how to update python2 into python3 in cloudshell?

    • @DustyBilbo
      @DustyBilbo 2 ปีที่แล้ว

      It already has python 3. I would recommend creating a venv.

  • @bpbartholomew
    @bpbartholomew 2 ปีที่แล้ว

    Thanks for this great video! Would you be able to do one connecting python to CGP PostgreSQL?

    • @KunalKMehta08
      @KunalKMehta08  2 ปีที่แล้ว

      Hey Brian, I honestly haven't tried it, I can do so and let you know for sure.

  • @kalyanimadhukarahire2836
    @kalyanimadhukarahire2836 ปีที่แล้ว +1

    its free to use

    • @KunalKMehta08
      @KunalKMehta08  ปีที่แล้ว

      GCP is not a free platform, it's cheap for sure, not free though.

  • @hins751
    @hins751 3 ปีที่แล้ว +1

    where is the command?

    • @KunalKMehta08
      @KunalKMehta08  3 ปีที่แล้ว +1

      Hey buddy, which command are you looking for?

    • @hins751
      @hins751 3 ปีที่แล้ว +1

      @@KunalKMehta08 create table

    • @KunalKMehta08
      @KunalKMehta08  3 ปีที่แล้ว +1

      @@hins751 Hey buddy, sorry for being late, it seems like I missed this comment. I have a handbook that I created for SQL commands a while back, along with some information about how it works, at a very basic level, and I am sharing the same here with you, hope this helps.
      drive.google.com/file/d/1rKW5gDJfLPzDFpM7bLNilnDW4j6KvzWi/view?usp=sharing
      Again, apologies for being late.

  • @RyszardKozlowski
    @RyszardKozlowski 2 ปีที่แล้ว +2

    It was not working for me. I found solution here: th-cam.com/video/SPvA858VnX0/w-d-xo.html - there was a need to add Ip adress so it was able to connect

    • @KunalKMehta08
      @KunalKMehta08  2 ปีที่แล้ว

      Thanks a lot for sharing the link here, Ryszard. Much appreciate it

    • @antoniocamposrodriguez3726
      @antoniocamposrodriguez3726 ปีที่แล้ว

      Thanks! I couldn't connect due to the same reason. Now I'm wondering how to connect from a Docker container now? I mean waht would be the ip address of a docker container? :(

    • @Wtk_Ncs
      @Wtk_Ncs ปีที่แล้ว

      thanks dude!