[Backend #2] Install & use Docker + Postgres + TablePlus to create DB schema

Поділитися
Вставка
  • Опубліковано 25 жов 2024

КОМЕНТАРІ • 111

  • @moiseslezama9781
    @moiseslezama9781 19 днів тому

    Man you are so clear on your lectures

  • @aminuolawale1843
    @aminuolawale1843 3 роки тому +14

    The clarity and pace of your teaching are just perfect.

  • @vincentadams3807
    @vincentadams3807 3 роки тому +4

    teaching me what university failed to, thank you so much. These videos deserve millions of views.

  • @mannerism6286
    @mannerism6286 3 роки тому +13

    Just pure respect for the clarity and the quality of information you voluntarily share with us all.

  • @wahebbenzaid543
    @wahebbenzaid543 Рік тому +1

    Perfect, nothing to say or add! thank you for your effort and for sharing this all knowledge with us!

  • @bernardoalves3642
    @bernardoalves3642 2 роки тому +13

    Wanted to add that if by any chance you already have psql installed on your local machine serving the port 5432, tableplus will try to connect to that local psql instance.
    To work around this, when running the docker set your port to 5433:5432 (just an example) and then choose port 5433 on tableplus.

  • @rishabhagrawalzra
    @rishabhagrawalzra 2 роки тому +1

    Hi, TECH SCHOOL, you just made my day with this awsome playlist

  • @vedantshinde2277
    @vedantshinde2277 3 роки тому +2

    I'm so excited to go through this entire series! Thank you for it!!

  • @brian-lau
    @brian-lau Рік тому

    Brian is making progress

  • @lakshminarayana3236
    @lakshminarayana3236 2 роки тому +1

    Nevr before ever after , such a nice explanation on db design

  • @steviecoyle
    @steviecoyle 4 роки тому +2

    You helped me solve my port bridging. Thanks. Great explaination.

  • @makhchanemosaab1355
    @makhchanemosaab1355 10 місяців тому

    For the rest of the series are we going to use WSL or Poweshell ?

  • @vic_shine
    @vic_shine 4 роки тому +1

    Thanks for such a detailed tutorial!
    One question for more understand: as I know, all data on Docker containers destroyed, when I stop container. So, how to save database data using Docker? For example, for backup or transfer between servers? Would be great to video tutorial or dev.to article about this process.

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому +1

      Hi Vic, good question! To make sure data is not deleted when the container is removed, we should use docker volume. I will definitely make a video about it in the future lectures.
      Also posted this article on dev: dev.to/techschoolguru/install-use-docker-postgres-table-plus-to-create-db-schema-44he

  • @SAHILSIDDIQUI-o9w
    @SAHILSIDDIQUI-o9w Місяць тому

    Connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "root" this shows up everytime i try to connect with tableplus can you help with this?

  • @i-am-learning-life
    @i-am-learning-life 4 роки тому +1

    Content is amazing love to learn more 😍😍😍

  • @stt106
    @stt106 2 роки тому

    Hi I am doing exactly what's said in the video but have trouble connecting to the database from TablePlus; it says "role root doesn't exist". What could I have done wrong? Thanks.

  • @connorcantrell1883
    @connorcantrell1883 3 роки тому +2

    Brilliant tutorial. I am stuck at testing the database (9:40) with TablePlus. I am receiving `FATAL: role "root" does not exist`. Help would be greatly appreciated!

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  3 роки тому +5

      Hi Connor,
      Did you run this exact query to create the postgres container?
      docker run --name postgres12 -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
      Also, make sure that there's no other hidden postgres server running on the host machine that can cause the conflicts.

    • @connorcantrell1883
      @connorcantrell1883 3 роки тому +4

      @@TECHSCHOOLGURU Thank you, I had a hidden postgres server running on my host machine!

    • @imabeastyaok
      @imabeastyaok 3 роки тому +1

      @@connorcantrell1883 how did you fix this?

    • @connorcantrell1883
      @connorcantrell1883 3 роки тому +2

      @@imabeastyaok `sudo pkill -u postgres`

    • @symbi21
      @symbi21 2 роки тому

      same problem, i opened postgres application in the same time

  • @blackaccel
    @blackaccel 4 роки тому +14

    So for anyone following this process with WSL2 in Windows, maybe you tried to connect to postgres from TablePlus and it send an error. That is because Docker doesn't share the same IP address when installed with WSL2. So to access the server in the Docker container:
    - Find out the IP of your WSL session. Type "ip a" from within WSL2.
    - Connect to TablePlus with the address of the WSL session.
    Example of the Docker container address I got 172.20.190.192/20. And remove the /20 when connecting to TablePlus

  • @sajirt2069
    @sajirt2069 3 роки тому +1

    Thanks for the tutorials. It helped me a lot.
    Is there a way to use do database migrations without using docker?

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  3 роки тому +1

      Hi Sajir, you can install db directly on your host machine, it will also work.
      But I recommend using docker because it's very easy to install, remove, update db version, or run multiple db instances if we want.

    • @sajirt2069
      @sajirt2069 3 роки тому

      ​@@TECHSCHOOLGURU Docker installation seems like a big big task in a windows home edition, since it requires hyper-v (according to windows documentation).

  • @johntony366
    @johntony366 Рік тому

    Awesome video, very helpful. I prefer beekeeper studio community edition for database gui

  • @duyhoangta7988
    @duyhoangta7988 2 роки тому +1

    Cám ơn bạn vì những video hướng dẫn

  • @codingwithtony
    @codingwithtony 3 роки тому

    Thank you for videos! Great content for me.

  • @berkekaancetinkaya8721
    @berkekaancetinkaya8721 3 роки тому

    Hi, I am new to databases, can we also use table plus if our container is running on the cloud?
    I guess we can't. So maybe it's better to not use GUI tools?

  • @EGroupGroupE
    @EGroupGroupE 3 роки тому

    Thank you, you helped me a lot.

  • @coding_in_focus
    @coding_in_focus 9 місяців тому

    where from you got these commands

  • @jackwhitely8671
    @jackwhitely8671 3 роки тому +1

    Thnks so much. Issue connecting to tableplus. I'm receiving error: "FATAL: role "root" does not exist" for the credential area "database" . It doesnt accept root

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  3 роки тому

      Hey Jack, make sure you pass these environment variables when running the container: POSTGRES_USER and POSTGRES_PASSWORD. Here's the command:
      docker run --name postgres12 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -p 5432:5432 -d postgres:12-alpine
      You can find all detailed commands in this post: dev.to/techschoolguru/install-use-docker-postgres-table-plus-to-create-db-schema-44he
      Also if you have other postgres server instance installed on your host machine, you should remove it completely to avoid conflict.

  • @tuandungnguyen560
    @tuandungnguyen560 3 роки тому +1

    Cảm ơn anh, vids của anh thực sự rất hữu ích ! Chúc anh luôn mạnh khỏe !

  • @gorangratte2471
    @gorangratte2471 2 роки тому +1

    at 8:00 you can also just type the first character(s) of the docker id.
    if there is only one id that starts with 7 (79711fc0f51c) you can use $ docker exec -it 7 psql

  • @sanjayojha1
    @sanjayojha1 Рік тому

    Is there a way to install it on windows without WSL?

  • @mohammadrezabehzadfar8122
    @mohammadrezabehzadfar8122 Рік тому

    very nice videos thanks a lot, can you make tutorial for mongodb too

  • @gcode1816
    @gcode1816 Рік тому +1

    I need a small help when I am trying to execute exported postgres sql query in tableplus it is showing "error: relation "transfer" does not exist", can anyone help me out here

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  Рік тому

      Make sure you have created the "transfers" table in your migration SQL files.
      Here's my code: github.com/techschool/simplebank/blob/master/db/migration/000001_init_schema.up.sql#L16
      And note that the table name is "transfers" with an "s", not just "transfer".
      If you want more help, feel free to join Tech School's discord server to chat directly with me and other students: discord.com/invite/BksFFXu

  • @mehmetesen9385
    @mehmetesen9385 4 роки тому

    Thanks for great work but I could not connect dockerized postgres server to the table plus.

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому +1

      Hi Mehmet, can you tell me what error did you get?
      Make sure you have used port mapping when running the container, and enter the correct username and password to TablePlus.
      Here's the docker run command:
      docker run --name postgres12 -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine

    • @mehmetesen9385
      @mehmetesen9385 4 роки тому +1

      @@TECHSCHOOLGURU Sorry for delay, I didn't get notification bro. I solved the issue by cleaning my local postgres installation leftovers on my machine. Now it's works.

  • @yogithesymbian
    @yogithesymbian 3 роки тому +1

    can you share the .sql file simple bank ?

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  3 роки тому

      You can find the SQL file in the simplebank repository: github.com/techschool/simplebank/blob/master/db/migration/000001_init_schema.up.sql

  • @quanghainguyen6632
    @quanghainguyen6632 3 роки тому

    Hello, I got the error when creating a connection on TablePlus. I have tried to search around but couldn't fix it. Could anyone pls help?
    "server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request."

  • @Sunburntghost
    @Sunburntghost 2 роки тому

    Hey, any recommendations for an alternative to tableplus? Its linux version is still an alpha release and crashes right at the start (regarding their Github repo, this error is already known).

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  2 роки тому +1

      You can check out this page: wiki.postgresql.org/wiki/PostgreSQL_Clients
      They listed several GUI db clients for each platform

    • @Sunburntghost
      @Sunburntghost 2 роки тому

      @@TECHSCHOOLGURU Thank you for the quick reply and especially for this educational course.

  • @LWeRNeO
    @LWeRNeO Рік тому

    I just wonder what am I doing wrong. When I connect to DB using DBeaver, everything works fine and I can see my tables, but when I try to use TablePlus they are jus not there. There are a lot of random tables that are not visible in the beaver but visible in table plus.
    Ok, I figured it out. For those on linux(ubuntu), be aware if you have docker and docker desktop installed. They have different contexts.

    • @MrBahciao
      @MrBahciao Рік тому

      Hello man, i'm having the same error, how did u get through?

    • @LWeRNeO
      @LWeRNeO Рік тому +1

      @@MrBahciao I didn't. I just installed DataGrip.

  • @Dzikrullah_999
    @Dzikrullah_999 Рік тому

    amazing !!

  • @i-am-learning-life
    @i-am-learning-life 4 роки тому

    I just wanted to know if we want to upload video and images how can we do that ??

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому

      Sure there will be a video about it in future lectures.

  • @cashcowislive
    @cashcowislive 2 роки тому

    Docker container keeps on stopping! I am using mysql database in windows..

    • @cashcowislive
      @cashcowislive 2 роки тому

      got it running using.. docker run --name mysql12 -p 3303:3306 -e MYSQL_ROOT_PASSWORD=secret -d mysql

    • @cashcowislive
      @cashcowislive 2 роки тому

      Logged in into mysql using.. docker exec -it mysql13 mysql -uroot -psecret

  • @bittom
    @bittom 2 роки тому

    安装 docker 之后使用 docker ps 找 containers,使用 docker images 找镜像
    到 docker hub 网站找 postgre,点击官方的安装相关命令,然后装 12-alpine
    docker pull 指定版本
    docker run 设置 root 名字 密码 背景 从镜像中得到不同的容器
    后续注意用 -p 安装对应镜像接口
    然后启动容器,使用 docker exec -it 容器NAMES psql(启动 console) -U root(以根目录用户启动)
    此时注意是不需要输入密码的,默认就是不用
    此时可以使用各种 query 命令
    postgre 可以有自己的 docker 相关镜像设置,跟随教程可以完成用户名、密码和端口设置
    其实看后面有 tablePlus 专门设置相关内容,此时设置之前的 .sql 文件默认打开,注意修改之前的文件设置为 not null

  • @sudhanshushekhar5905
    @sudhanshushekhar5905 2 роки тому

    why not use pgAdmin ?

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  2 роки тому +1

      You can use pgAdmin as well. I use TablePlus because I like it.

  • @vanillasrecaps6022
    @vanillasrecaps6022 Рік тому

    I'm stuck because tableplus is on trial

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  Рік тому

      Why are you stuck? I also use the free version of TablePlus. We can still use all of its features, except that there can be at most 2 tabs open at the same time. So just close 1 tab before trying to open the third one, and it should work fine.
      Having said that, using TablePlus is not mandatory. You can always use any other Postgres GUI client tool to connect to the database: scalegrid.io/blog/which-is-the-best-postgresql-gui-2021-comparison/

    • @vanillasrecaps6022
      @vanillasrecaps6022 Рік тому

      @@TECHSCHOOLGURU yeah nvm I thought it says 2 table sorry

  • @jeremyjohns9615
    @jeremyjohns9615 4 роки тому

    I have issues with connecting to TablePlus.
    I have previuosly installed PostgreSQL and pgAdmin.
    After pulling image from docker hub, creating a postgres container with port number, username and password details.
    But when I install TablePlus and try to connect to postgres database but the issue is coming up.
    Then, I uninstalled the PostgreSQL and pgAdmin, but now I have totally different error such as
    " could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
    could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432? "
    Does anyone faced this issue?
    P.S: I am using Windows 10 Home (installed Docker Tool Box)

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому +1

      Hi Jeremy, make sure your postgres container is up and running, and has correct port mapping.
      Run this command: docker ps -a
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      f9cdf61fcb0a postgres:12-alpine "docker-entrypoint.s…" 2 months ago Up 7 days 0.0.0.0:5432->5432/tcp postgres12

    • @jeremyjohns9615
      @jeremyjohns9615 4 роки тому

      @@TECHSCHOOLGURU it is up and running and port numbers are correct. Also, I went into my container and created another database. container name: some-postgres; username: postgresdb
      See the code from my VSCode Terminal below:
      $ docker exec -it some-postgres bash
      bash-5.0# psql -U postgresdb
      psql (13.0)
      Type "help" for help.
      postgresdb=# create database simple_bank;
      CREATE DATABASE
      postgresdb=# create database postgresdb;
      ERROR: database "postgresdb" already exists
      postgresdb=# \q
      bash-5.0# psql -h localhost -p 5432 -U postgresdb -W
      Password:
      psql (13.0)
      Type "help" for help.
      postgresdb=# \l
      List of databases
      Name | Owner | Encoding | Collate | Ctype | Access privileges
      -------------+------------+----------+------------+------------+---------------------------
      postgres | postgresdb | UTF8 | en_US.utf8 | en_US.utf8 |
      postgresdb | postgresdb | UTF8 | en_US.utf8 | en_US.utf8 |
      simple_bank | postgresdb | UTF8 | en_US.utf8 | en_US.utf8 |
      template0 | postgresdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgresdb +
      | | | | | postgresdb=CTc/postgresdb
      template1 | postgresdb | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgresdb +
      | | | | | postgresdb=CTc/postgresdb
      (5 rows)
      postgresdb=# \c
      Password for user postgresdb:
      You are now connected to database "postgresdb" as user "postgresdb".
      postgresdb=# \q
      bash-5.0# \q
      bash: q: command not found
      bash-5.0# exit
      exit
      As you can see from the code using terminal, the container is working fine BUT still I cannot connect it to TablePlus.
      Is there any alternatives for TablePlus or do I have to install PostgreSQL too (I do not have PostgreSQL installed at the moment)?

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому

      Can you show me the result of this command: docker ps
      And also the parameters you're using in TablePlus to connect to that db?

    • @jeremyjohns9615
      @jeremyjohns9615 4 роки тому

      $ docker ps
      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      84f3b59b9fc4 postgres:13-alpine "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:5432->5432/tcp some-postgres
      I have re-installed PostgreSQL 13 now, and it is giving different error:
      FATAL: password authentication failed for user "postgresdb"

    • @jeremyjohns9615
      @jeremyjohns9615 4 роки тому

      But the details are CORRECT 100%. Checked it multiple times

  • @cyberinfo6147
    @cyberinfo6147 5 місяців тому +1

    I do everything just like the video , but when I try to connect to postgres with table plus even tho I'm sure the password is correct, I get fatal:password authentication failed for user "root" , can anyone help me with this ??

  • @邓卓帆
    @邓卓帆 3 місяці тому

    Crafted by Merlin AI.
    Crafted by Merlin AI.

  • @Ramu294
    @Ramu294 4 роки тому

    docker ps shows nothing ? why

    • @TECHSCHOOLGURU
      @TECHSCHOOLGURU  4 роки тому

      Perhaps your container is stopped (not running). You can try "docker ps -a" to list all containers to check that.

  • @noahrobert6748
    @noahrobert6748 2 роки тому

    If you want to download the latest version of this software so links are given below!
    prcrack.org/tableplus-crack-download/