[Docker] Connection with MySQL

Overview

--Connecting host and container standard output

Linking standard output

--Check CONTAINER ID or NAMES with ps option

% docker ps
CONTAINER ID   IMAGE               COMMAND                  CREATED      STATUS         PORTS                    NAMES

--Connect standard output with it option --- i: Connect standard I / O of host to container --- t: Connect the standard input / output of the container to the container

% docker exec -it [CONTAINER ID or NAMES] bash

--Login to mysql (check pass in database.yml) --- u: User specification --- p: Use password

% mysql -u root -p

that's all

Recommended Posts

[Docker] Connection with MySQL
[Template] MySQL connection with Java
Rails + MySQL environment construction with Docker
[PDO → DB connection with docker, PHP]
JDBC connection with MySQL 8.x * Notes *
[Environment construction with Docker] Rails 6 & MySQL 8
mysql doesn't start up with docker.
Update MySQL from 5.7 to 8.0 with Docker
MySql connection error
Create Rails 6 + MySQL environment with Docker compose
Deploy to heroku with Docker (Rails 6, MySQL)
Edit Mysql with commands in Docker environment
Create a MySQL environment with Docker from 0-> 1
Laravel + MySQL + phpMyadmin environment construction with Docker
Allow image posting with [Docker + WordPress + MySQL]
Implement simple CRUD with Go + MySQL + Docker
Rails deploy with Docker
Run Pico with docker
Explode Docker with WSL2
Use Puphpeteer with Docker
Operate Emby with Docker
Use ngrok with Docker
Run Payara with Docker
Php settings with Docker
[Rails] Development with MySQL
React + Django + Nginx + MySQL environment construction with Docker
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
Build Rails (API) x MySQL x Nuxt.js environment with Docker
Use GDAL with Python with Docker
Deploy with EC2 / Docker / Laravel
Run TAO Core with Docker
Docker management with VS Code
Set up GitLab with docker
Get started with DynamoDB with docker
Docker autostart settings with wsl2
Connect to MySQL 8 with Java
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
Version control CocoaPods with Docker
Web application built with docker (1)
I tried BIND with Docker
React environment construction with Docker
Build DynamoDB local with Docker
VisualVM (JMX connection) with Kubernetes
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
I tried to make an introduction to PHP + MySQL with Docker
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Easy environment construction of MySQL and Redis with Docker and Alfred
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
How to use mysql with M1 mac Docker preview version
docker-compose.yml when you want to keep mysql running with docker
Measures for permissions when building MySQL with Docker on WSL2
Node.js environment construction with Docker Compose
Run lambda with custom docker image
Deploy a Docker application with Greengrass
Build Couchbase local environment with Docker
Install java with Ubuntu 16.04 based Docker