ankit-brijwasi
Posted on October 16, 2021
Recently while working, I was required to connect to a database that was running on a docker container using psql.
If you are also dealing with something like this, then, follow along
1. Start the docker container
$ docker run -d container_name
2. Now run the following command
$ psql -h localhost -p 5432 -U username -d database_name
Password for user username:
psql (12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))
Type "help" for help.
database_name=>
And that's it
Thank you for reading!
Have a nice day!π
π πͺ π
π©
ankit-brijwasi
Posted on October 16, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.