For all those who are getting Fatal error, password authentication error etc. Use postgres as username in the database connection dbeaver. The - - name some-name in the run command is only used to stop or resume the container it is not the login user name of the database.
Near the beginning of the video, the author claimed that "some-postgres" is the name of the image and near the end, he said it's the name of the container. They are two separate things.
To anyone getting this error: FATAL: password authentication failed for user "postgres" The problem is you probably already have postgres installed in your machine, and probably running, which is using the same port docker is trying to use. To solve this, you just need to uninstall the postgres already installed in your machine if you dont have any relevant db in it. Docker already have postgres and some other list of databases there, like you see from the video (7:40), when you click to connect from your DBeaver, you can choose postgres from the list, and your connection should be up and running.... hopefully that helps!
Hey thanks man, very helpful. Also I saw your channel is dedicated to database. I'm trying to learn database design and found not many good resources for that, probably you can take that up as video playlist? Like given a app idea or feature idea, design a database that's efficient
Glad you liked the video! Yeah it is dedicated to databases. Sure I can create a playlist for that. I have a couple of videos on database design, but haven't created that many. I'll create some more soon.
Great video. I try to follow your video but I get the error as below: "INTERNAL SERVER ERROR: Unable to connect to server: connection to server at "localhost"(::1), port 5432 failed:
Video makes some incorrect statements, one of which is that a Docker hub account is required to access images. That is false. A Docker hub account is required only for pushing images to it.
Hmm I'm not sure what the issue could be. I assume you're using the same docker command as on the website. Perhaps there's a missing character or a spelling issue. Otherwise, I'm not sure.
What would be awesome is if you could do a video showing this with adding how to allow remote access to the psql db via configuring the pg_hba files when building it in docker. Other wise these vids are a dime a dozen...........dare excepted?
I am having this error: FATAL: password authentication failed for user "some-postgres". I have tried to uninstall postgres server. I am using windows. Help, please!
I am guessing that the command you're using isn't quite correct (perhaps it's wrong in my video too). The some-postgres is the container name, not the username. Perhaps there's a space or a quote in the wrong place. Which command are you running?
All set up and running. I was hoping that I could add this to Google Cloud Run as a container but that doesn't guarantee the data. Can you suggest a cheap way of hosting the Docker Postgres database image that does guarantee that the data is kept? (thanks for the video)
Great idea! There are several ways to host them online, but I can create some videos on doing this. I also have a video coming soon on using Docker volumes to save data permanently which could help.
@@DatabaseStar sorry, only just saw your reply. I wonder if you can persist the data using Cloud Run. Maybe in a VM? It would be nice to see something though :)
I don't get it, what's the need of the postgres container, if we have to connect to the actual database, like as I a developer I have to install Postgres anyway, so what's the use?
Good question. Containers have many benefits which I'm still looking into. They are helpful in the deployment process and can be created easily to help with testing.
@@DatabaseStar should not it be like, I run a container, bind the port, and mount a volume (using -v flag) so as to persist the data... without installing the PostgreSQL.
when I was trying to demonstrate the tutorial using DBeaver Comunity especially for testing the database connection, I faced this error below picture " The connection attempt failed. EOFException java.io.EOFException", Sir if you can help me
I am really confused by the having to add -p and specifying the port only because when I was looking through the document in the docker hub site it was not there or did I miss it somehow?
Connection refused: Check that host name and port are correct and that the postmaster is accepting TCP/IP connections. I have postgres 14.9-alpine3.17 image is running as a container. At the end of the docker run command, I have given postgres:14.9-alpine3.17. Is this the problem?
@@DatabaseStar Yes, The container was running and the name matched the docker image. I'm running Docker Toolbox on Windows 8, 64-bit processor. I have a doubt, What is the host name? We are trying to connect to the container yeah? so the host name maybe the same as docker container name? Is there a connection string option available?
Good questions! I don’t think the data will persist if you stop and start the container. There’s a concept called mounting which I think will allow data to be saved, but I haven’t looked into it. I will soon and make a video on it. Starting on reboot, I’m not sure how to do that either, but it’s a good idea and I’ll look into it
You can use a volume to persist your data With this command you create a volume named dbPostgres11 docker volume create dbPostgres11 Then you have to pass this volume to the docker container with flag --mount So. the command to run your progress is the next, I needed to install postgres11, so the :bullseye is just a tag to install that version, you can see this here: hub.docker.com/_/postgres The src is the volume and the destination is /var/lib/postresql because is a common location for PGDATA docker run --name postgress11 --mount src=dbPostgres1,dst=/var/lib/postgresql -p 5432:5432 -e POSTGRES_PASSWORD=root -d postgres:bullseye This persist my data, If you cannt see your tables and data in DBeaver, you have to refresh your connection with F5 or right click in connection name and select refresh.
How can I check that my Postgres project is in the container? I already had a project in a database. I followed the tutorial and added the same password as my project when running the Postgres image. how to make sure it is run in the container?
@@DatabaseStar yeah, that's what I meant. I believe I've found out how to do it, but I don't know if this is even such a good idea in the first place, and if docker should be used in production. Currently I just have two containers, a base image, and a postgres image, and I use docker compose. But what happens, if the postgres image version gets updated? Will the persistent data (with volumes) still be correct? Anyway, would be cool if you made a video)
I have created a container but after creation, it automatically reaches the exit status. even I tried "docker start id" still unable to start them then please tell me how would I enter in bash terminal or how to start that container
Are you getting an error message? I'm not sure what would be causing this issue. I think there's a way to see the logs in Docker which could give you more information.
whatever container I am creating is in a running state and I am able to stop or start that container manually. but when I create any container using Postgress then automatically it stops and shows exited 5 seconds ago in the status column. I use docker run container id, it runs successfully then again after 2-3 second when i enter docker ps then the container doesn't appear there. when i enter docker ps -a then it shows and written over there exited 5 seconds aga. kindly tell me the solution i am inthe middle of something. please provide me any other platform's link where i can share the photos to you and that helps me to get over it.
Good question. These containers are there as I had set up other containers before recording this video. When you install Docker Desktop fresh, there will be no containers in this list.
MySQL Workbench and dBeaver are both tools for working with SQL. The basic functionality between the two tools are the same. However, MySQL Workbench is just for MySQL databases, and DBeaver works on many databases including MySQL and Postgres.
What happens when you run the command "docker ps"? Is the container running? If so, then perhaps a Google search for the error, or checking the docker logs (I think there's a command for seeing docker logs)
This is a program called DBeaver. It's a tool that is used to run SQL queries on many databases including PostgreSQL. Postgres comes with something called pgAdmin, but I didn't demo it because I have trouble using it (and many others have trouble as well). You can download dbeaver from their website, open it, and it looks like the UI in the video.
Do you mean from a different computer? Or from a different IDE? If it's another computer I don't think it's possible because the Docker container is running on your computer. Maybe it is possible but I don't know how. If it's from another IDE on your computer, then you can enter the connection details into the connection screen in your IDE.
Thanks for this video. I have an error : Network error Motif: Network unavailable: javax.net.ssl.SSLHandshakeException:Remote host terminated the handshake I can't find how to solve this error. Thanks for your help.
$ docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres I Keep getting the error message ; zsh: command not found: $ when i enter the above in my terminal? please help @database star
I think that means the Docker command is not recognised. Has docker been installed? If so, I would suggest looking up how to add the Docker command to your “bash profile”
Hello, thank you for the explanation, but I get this error: SQL Error [42P07]: ERROR: relation "cars" already exists even though I never created this table before and only select row() works fine. Everything else is just like that gives me an error. Could you please give me a solution?
Hi, that error means that the table already exists when you try to create a table called "cars". What if you run: select * from cars? This may show you the data in the table, or just that the table exists. You can delete the table by running DROP TABLE cars;
Thank you. This is how all tutorials should be made: Short, Clear instructions to follow, To the point. Simplicity is so beautiful but hard to find.
For all those who are getting Fatal error, password authentication error etc. Use postgres as username in the database connection dbeaver. The - - name some-name in the run command is only used to stop or resume the container it is not the login user name of the database.
Thanks for the tip!
Such a good video and explanation, after a while I mumbled around the web, your 10 minute video got me exactly where I needed. Thank you!
Thanks, glad it helped! Yeah I found many of the other Docker tutorials weren't that helpful.
this video is practically reading a readme with extra steps
All is true for me also!
Near the beginning of the video, the author claimed that "some-postgres" is the name of the image and near the end, he said it's the name of the container. They are two separate things.
Good point, yea you are right they are different. Thanks for mentioning it here for others to notice too.
I can't express how grateful I am for this video. Thank you so muuuuuch, you have no idea how much you helped me!
No problem, I’m glad it helped you!
This is the BEST tutorial I've ever seen!!!!
Thanks! Glad you like it
for anyone having error: FATAL: password authentication failed for user "postgres" - uninstall postgres server on your main OS, it blocks port
Thanks for sharing, I think I’ve had that same error before too.
@@DatabaseStar Can you pin this? Our whole class had this problem from another Postgres lesson
Wouldn't setting a different port be a better option here? Seems excessive to remove postures from your hd.
U can use another new port by mapping it
-p 5431:5432
@@collinsnnadozie5092 this must be pinned
Thank you for explaining this better, and more succinctly than my college materials 🤝 👍
Happy to help!
To anyone getting this error: FATAL: password authentication failed for user "postgres"
The problem is you probably already have postgres installed in your machine, and probably running, which is using the same port docker is trying to use.
To solve this, you just need to uninstall the postgres already installed in your machine if you dont have any relevant db in it.
Docker already have postgres and some other list of databases there, like you see from the video (7:40), when you click to connect from your DBeaver, you can choose postgres from the list, and your connection should be up and running.... hopefully that helps!
Awesome, thanks for the tip and solution!
I love you so much, marry me
Wouldn't simply changing port help?
thanks a lot
thank you so much! i was stressed out looking for an error that doesn't exist
This lesson is as sweet as Sugar. 🍬🍬Thank you for sharing
You’re welcome!
Thank you for this! Extremely easy given your tutorial...
You're very welcome!
That was a really simple and instructive video. Thanks.
Glad it was helpful!
Thank you for that elaborate and concise explanation!
Thanks! Glad it was helpful!
Hey thanks man, very helpful.
Also I saw your channel is dedicated to database.
I'm trying to learn database design and found not many good resources for that, probably you can take that up as video playlist?
Like given a app idea or feature idea, design a database that's efficient
Glad you liked the video!
Yeah it is dedicated to databases. Sure I can create a playlist for that. I have a couple of videos on database design, but haven't created that many. I'll create some more soon.
awesome. thanks for saving our time.
No problem!
great video, thank you for such an easy explanation!
You're very welcome!
great video, crisp and clear
Thanks!
Excellent explanations. Thanks a lot for the clarity. From now I'm a new of your channel followers.
Thanks a lot Ben!
Awesome, thank you!
You really helped me test the connection by making the video. Thanks man
You’re welcome!
thank you sir , for such gold mines
You're welcome!
I love the way you explain, thanks a lot!
You're welcome!
thank you sir, in my case I was creating everything well, except for the port binding between host:container , leaving that blank
Good to hear you got it solved.
This tutorial is helpful for Linux users too. Thank you.
Glad it was helpful!
I am grateful for this video. Thank you very much
Thanks! Glad you like it.
great instructions for istallin dadabase on docka
Thanks!
Thank you so much for the tutorial. It is very helpful for me, also u explain all steps very clear, good job.
Glad to hear it was helpful!
Thank you so much, this was all I needed.
Glad it helped!
Very good explanation. Thank you very much.
Thanks, glad you liked it!
Thank you sir! That was useful.
Glad it was helpful!
Simple and clearly, thank you very much.
You are welcome!
Thnaks sir. You explained it very well and helped me a lot 👍👍
You're welcome!
Thank you so much for the video. It was very clear and useful :)
Thanks, glad you liked it!
Great video. I try to follow your video but I get the error as below:
"INTERNAL SERVER ERROR: Unable to connect to server: connection to server at "localhost"(::1), port 5432 failed:
Hmm I’m not sure how to solve that one unfortunately. Glad you liked the video though.
Can we also have a video for PostrgreSQL/Docker installation on Linux please?
Good idea, but I don’t have any experience with using Linux. I imagine the process is similar.
Thank you for the tutorial, very simple and helpful
Thanks, glad you liked it!
00:03:42 Thank You some-progress is the name of container not the name of image… name of the image is postgres. Just sharing :)
Ah thanks for the correction!
Video makes some incorrect statements, one of which is that a Docker hub account is required to access images. That is false. A Docker hub account is required only for pushing images to it.
Thanks for the info Matt! I wasn't aware that you didnt need a Docker Hub account.
Thank you sir, it is very beneficial video!
Glad you like it!
This was really helpful.
Glad it helped!
Hello, could you help me I get this error > FATAL: role "postgres" does not exist ; Don't understand what I did wrong
Hmm I'm not sure what the issue could be. I assume you're using the same docker command as on the website. Perhaps there's a missing character or a spelling issue. Otherwise, I'm not sure.
Thank you.
You’re welcome!
Great video thanks!
Glad you liked it!
What would be awesome is if you could do a video showing this with adding how to allow remote access to the psql db via configuring the pg_hba files when building it in docker. Other wise these vids are a dime a dozen...........dare excepted?
That sounds like a good idea for a video!
I am having this error: FATAL: password authentication failed for user "some-postgres". I have tried to uninstall postgres server. I am using windows. Help, please!
I am guessing that the command you're using isn't quite correct (perhaps it's wrong in my video too). The some-postgres is the container name, not the username. Perhaps there's a space or a quote in the wrong place. Which command are you running?
Thanks for the video sir, it helped me ✨
Glad it was helpful!
Thank you, my best investment today
Excellent!
Get your FREE cheat sheet of Docker commands: www.databasestar.com/docker-database-cheat-sheet/?
All set up and running. I was hoping that I could add this to Google Cloud Run as a container but that doesn't guarantee the data. Can you suggest a cheap way of hosting the Docker Postgres database image that does guarantee that the data is kept?
(thanks for the video)
Great idea! There are several ways to host them online, but I can create some videos on doing this. I also have a video coming soon on using Docker volumes to save data permanently which could help.
@@DatabaseStar sorry, only just saw your reply. I wonder if you can persist the data using Cloud Run. Maybe in a VM? It would be nice to see something though :)
Please make more videos so far you’re the only channel that explain in detail 🥲🥲🥲🥹🥹🥹
Thank you, I will!
I don't get it, what's the need of the postgres container, if we have to connect to the actual database, like as I a developer I have to install Postgres anyway, so what's the use?
Good question. Containers have many benefits which I'm still looking into. They are helpful in the deployment process and can be created easily to help with testing.
@@DatabaseStar should not it be like, I run a container, bind the port, and mount a volume (using -v flag) so as to persist the data... without installing the PostgreSQL.
when I was trying to demonstrate the tutorial using DBeaver Comunity especially for testing the database connection, I faced this error below picture " The connection attempt failed.
EOFException
java.io.EOFException", Sir if you can help me
I’m not sure what would be causing this issue, the message doesn’t say much
it worked perfectly.
Awesome!
I am really confused by the having to add -p and specifying the port only because when I was looking through the document in the docker hub site it was not there or did I miss it somehow?
I think you could get it working without specifying the port, as it may use a default. But if it doesn't work, try adding the port.
@@DatabaseStar I understand that but I just wanted the document to have this. I am grateful for the video though. Thank you!
Connection refused: Check that host name and port are correct and that the postmaster is accepting TCP/IP connections.
I have postgres 14.9-alpine3.17 image is running as a container.
At the end of the docker run command, I have given postgres:14.9-alpine3.17. Is this the problem?
I'm not sure if that's the problem. It should be working. Is the container running? Does the name match what you see in the list of docker images?
@@DatabaseStar Yes, The container was running and the name matched the docker image. I'm running Docker Toolbox on Windows 8, 64-bit processor.
I have a doubt, What is the host name? We are trying to connect to the container yeah? so the host name maybe the same as docker container name?
Is there a connection string option available?
Thanks!
But will the data persist? How to make it so that the docker container will start upon reboot?
Good questions! I don’t think the data will persist if you stop and start the container. There’s a concept called mounting which I think will allow data to be saved, but I haven’t looked into it. I will soon and make a video on it.
Starting on reboot, I’m not sure how to do that either, but it’s a good idea and I’ll look into it
You can use a volume to persist your data
With this command you create a volume named dbPostgres11
docker volume create dbPostgres11
Then you have to pass this volume to the docker container with flag --mount
So. the command to run your progress is the next, I needed to install postgres11, so the :bullseye is just a tag to install that version, you can see this here: hub.docker.com/_/postgres
The src is the volume and the destination is /var/lib/postresql because is a common location for PGDATA
docker run --name postgress11 --mount src=dbPostgres1,dst=/var/lib/postgresql -p 5432:5432 -e POSTGRES_PASSWORD=root -d postgres:bullseye
This persist my data, If you cannt see your tables and data in DBeaver, you have to refresh your connection with F5 or right click in connection name and select refresh.
Hi,
When running local Postgres in Docker, I encounter with this problem: Relation "X" does not exit Line 2 select * from ...
What is the reason?
Hey, this error happens because the table "X" does not exist. A relation is another name for a table.
@@DatabaseStar TNX alot
Thank you for sharing🙂
No problem!
Thanks for the video. How can I access local postgresql data from docker?
No problem! What do you mean by local postgresql data? Isn't the docker container running locally for you?
@@DatabaseStar Postgresql installed in my laptop. How can I access this Postgres database tables from a container?
Ah thanks for clarifying. I'm not sure how to do that actually. I'm still learning about containers and Docker though.
how to find the url and use it for prisma database url
I'm not sure how to use Prisma, but if you have Docker on your computer, could you use localhost?
How can I check that my Postgres project is in the container? I already had a project in a database. I followed the tutorial and added the same password as my project when running the Postgres image. how to make sure it is run in the container?
What do you mean by Postgres project? Do you mean your tables and data, or something else?
thank you for the lesson))
You're welcome.
FATAL: password authentication failed for user "postgres". This error i am getting while test connection.
Hmm are you using the same password you had in the Docker run command?
I get the same error and I am sure password is correct.
Do you have a video about persistent data for PostgreSQL?
Do you mean persistent data using Docker? If so, I haven't created a video on that.
@@DatabaseStar yeah, that's what I meant. I believe I've found out how to do it, but I don't know if this is even such a good idea in the first place, and if docker should be used in production. Currently I just have two containers, a base image, and a postgres image, and I use docker compose. But what happens, if the postgres image version gets updated? Will the persistent data (with volumes) still be correct? Anyway, would be cool if you made a video)
I have created a container but after creation, it automatically reaches the exit status. even I tried "docker start id" still unable to start them then please tell me how would I enter in bash terminal or how to start that container
Are you getting an error message? I'm not sure what would be causing this issue. I think there's a way to see the logs in Docker which could give you more information.
whatever container I am creating is in a running state and I am able to stop or start that container manually. but when I create any container using Postgress then automatically it stops and shows exited 5 seconds ago in the status column. I use docker run container id, it runs successfully then again after 2-3 second when i enter docker ps then the container doesn't appear there. when i enter docker ps -a then it shows and written over there exited 5 seconds aga. kindly tell me the solution i am inthe middle of something. please provide me any other platform's link where i can share the photos to you and that helps me to get over it.
how to mount volume, so that previous data if any can be restored/reused?
I've got another video here that discusses mounts in Docker: th-cam.com/video/-pzptvcJNh0/w-d-xo.html
This command helped me, thank you..
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Good to know!
Me too!
01:30 You have just installed Docker Desktop. Why does Docker Desktop list 3 containers ? Have the images been downloaded and run automatically ?
Good question. These containers are there as I had set up other containers before recording this video. When you install Docker Desktop fresh, there will be no containers in this list.
We can do the same with mysql, what's the difference between mysql workbench and dbeaver?
MySQL Workbench and dBeaver are both tools for working with SQL. The basic functionality between the two tools are the same. However, MySQL Workbench is just for MySQL databases, and DBeaver works on many databases including MySQL and Postgres.
Thank you so much.
Glad you like it!
I have my own application. I want to set my own password and while entrying i want databases that i have created . How can i do that ???
I don’t think I understand. If you want to create a database you can do that within Postgres using a tool such as pgAdmin
Can we connect postgres database to docker without DBeaver
Yes you can, you can use any other IDE that supports Postgres (such as pgAdmin, Postico)
Connection refused. It's running. I checked user name and password twice.
What happens when you run the command "docker ps"? Is the container running? If so, then perhaps a Google search for the error, or checking the docker logs (I think there's a command for seeing docker logs)
What is the IDE you are using to connect to database ?
The IDE I use here is called DBeaver. But you can do the same thing with pgAdmin which comes with Postgres.
@@DatabaseStar Thank you. I already have pgAdmin. However wanted to explore some multi-platform tool.
How do you come to the UI at 7:22? I follow the previous steps but there isn't any UI opened
This is a program called DBeaver. It's a tool that is used to run SQL queries on many databases including PostgreSQL. Postgres comes with something called pgAdmin, but I didn't demo it because I have trouble using it (and many others have trouble as well). You can download dbeaver from their website, open it, and it looks like the UI in the video.
why can't I find anyone using postgres from a kubernetes pod?
I'm not sure, actually!
@@DatabaseStar do you know how to?
No idea, unfortunately. I've never used Kubernetes...
Thank you man
No problem!
5432 port is already in use what port should i use now?
You could use a slightly different port number such as 5433 or 5430
@@DatabaseStar Thank you for the quick response!
Can you tell me how I can connect to the db from another host?
Do you mean from a different computer? Or from a different IDE? If it's another computer I don't think it's possible because the Docker container is running on your computer. Maybe it is possible but I don't know how.
If it's from another IDE on your computer, then you can enter the connection details into the connection screen in your IDE.
How to add postgis with postgresql in docker
I'm not sure actually...
Clear!
Thanks!
FATAL: password authentication failed for user "postgres"
Does the password you enter match the one from the Docker run command?
@@DatabaseStar Absolutely, Yes.
You don't need a docker hub account for tired
That’s true. I think I either misunderstood the error message I was getting when I did this, or it has changed since then.
I get FATAL: password authentication failed for user
I am guessing the password you entered is incorrect. Is it the same one you used when you set up the container earlier in the video?
I get the same error and I am sure password is correct.
Its giving me same error as well. I had one DB instance running but I closed that still getting that error. Please guide.
thanks mate
You’re welcome!
Thanks :)
You're welcome
says the database postgres not exist
Oh that’s odd. Perhaps the database no longer comes with the image.
@@DatabaseStar The error is that in the host i already have a postgres after unistaled docker works fine.
Hi is there any way by which i can literally pass a secret password so that nobody can know the password while doing docker create
Hmm I'm not sure. There may be a way to use environment variables or some kind of configuration file, but I'm not sure.
god bless you 🙏🙏
Thanks!
thank sir
You're welcome!
merci 👍
You're welcome!
FATAL: role "postgres" does not exist
Which command did you run to get this error?
@@DatabaseStar 5432:5432 not working for mac m1, but working to 5433:5432 different port expose.
hocam problemi nasil cozdunuz yada cozebildiniz mi m1 kullaniyorum 2 gundur postgres de problem yasiyorum
@@mstgnz Same here
god speed
Thanks!
nice voice and video ahahhaha
Thanks!
Thanks for this video.
I have an error :
Network error
Motif:
Network unavailable:
javax.net.ssl.SSLHandshakeException:Remote host terminated the handshake
I can't find how to solve this error.
Thanks for your help.
Hmm that is odd. I haven't seen that error before unfortunately. Do you have any other Postgres databases running on your computer?
can we connect it with postgress url ? like this
postgres://username:password@host:5432/DBname
I think so but I haven't tried it. The database will be running on localhost so this should work.
$ docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
I Keep getting the error message ; zsh: command not found: $ when i enter the above in my terminal? please help @database star
I think that means the Docker command is not recognised. Has docker been installed? If so, I would suggest looking up how to add the Docker command to your “bash profile”
Remove the $ at the beginning of your command, then the problem will be fixed.
Hello, thank you for the explanation, but I get this error: SQL Error [42P07]: ERROR: relation "cars" already exists even though I never created this table before and only select row() works fine. Everything else is just like that gives me an error. Could you please give me a solution?
Hi, that error means that the table already exists when you try to create a table called "cars". What if you run: select * from cars? This may show you the data in the table, or just that the table exists. You can delete the table by running DROP TABLE cars;
how to connect metabase inside docker to postgres?
Metabase inside docker? I'm not sure as I don't have any experience with that.