38
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker上でMySQLにログインする

Last updated at Posted at 2018-08-05

自分用メモです。

コンソールから直接MySQLの中身を見に行くときの手順。

まずは

docker ps

を、投げてコンテナIDを確認する。

CONTAINER ID        IMAGE               COMMAND          CREATED             STATUS              PORTS                  NAMES
833a83481bcd        mysql:5.7           "docker-entrypoint.s…"   3 hours ago         Up 2 hours          3306/tcp                 rails_db_1

以下のコマンドを投げる

docker exec -it コンテナID mysql -u root -p

パスワードを求められるので、database.ymlに記述したパスワードを入力すればOK。

38
34
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
38
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?