Home Connect PostgreSQL in docker container with Azure Data Studio
Post
Cancel

Connect PostgreSQL in docker container with Azure Data Studio

Connect PostgreSQL in docker container with Azure Data Studio

Azure Data Studio is a cool product that can easily connect MySQL (if you already installed in your system) and show what in your database look like. What if we use PostgresSQL instead of MySQL, how should we start?

The 1st step, I decided to pull Postgres’s docker image but not to install at root.

1
$ docker pull postgres

Second, run the container, remember to set the port for local connecting (the document didn’t mention it)

1
$ docker run --name postgres-docker -e POSTGRES_PASSWROD=secret_password -p 5432:5432 -d postgres

then you will get container id, also can check it by docker ps

1
2
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                      NAMES
ba01d334f4db        postgres              "docker-entrypoint.s…"   37 minutes ago      Up 37 minutes       0.0.0.0:5432->5432/tcp     postgres-docker

After running the container, we could start the next step, set up the connection in Azure Data Studio.

1. Install PostgreSQL plug-in.

Choose the extension’s icon and search Postgres then install it.

2. Click new connection, choose PostgreSQL as your database.

3. Enter the required information.

4. Remember to set port in advanced setting.

Enter the ip and port as same as you assigned to docker container.

5. Connect and start to work in the database.


So far, the most important part is that remember to assign port when you run the docker container and enter the correct connection details, then it can keep your life much easier.

This post is licensed under CC BY 4.0 by the author.

Setting both Celery and Flask inside the docker-compose

How to train a customized Name Entities Recognition (NER) model based on spaCy pre-trained model

Comments powered by Disqus.