Skip to content

Instantly share code, notes, and snippets.

@tuhin47
Last active April 28, 2021 18:35
Show Gist options
  • Save tuhin47/c29cdad90f8e0cec404a2164e4e44752 to your computer and use it in GitHub Desktop.
Save tuhin47/c29cdad90f8e0cec404a2164e4e44752 to your computer and use it in GitHub Desktop.
Mysql Docker Run and Open By terminal

MySQL

Run MySQL docker Command:

docker run --name mysql47 -e MYSQL_ROOT_PASSWORD=root -p 3333:3306 -d mysql

Connect from terminal:

mysql -h 127.0.0.1 -P 3333 -u root -p

Postgres

Run Postgres docker Command:

docker run --name mypostgres -e POSTGRES_PASSWORD=root -d -p 5432:5432 postgres

Connect from terminal:

psql -h 127.0.0.1 -p 5432 -U postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment