3
2

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.

boot2dockerで複数のmysqlを実行

Last updated at Posted at 2014-12-06

mysqlmultiよりDockerの方が楽

インストール

boot2docker init
boot2docker up```


## DockerのIPを確認
```boot2docker ip```
このIPでホスト側OSから接続する

## mysqlをrun。今回はportで使い分けている。
```docker run -p 3306:3306 --name "db1" -e MYSQL_ROOT_PASSWORD="1234" -d mysql:5.6
docker run -p 3307:3306 --name "db2" -e MYSQL_ROOT_PASSWORD="1234" -d mysql:5.6
docker run -p 3308:3306 --name "db3" -e MYSQL_ROOT_PASSWORD="1234" -d mysql:5.6

2回目実行時

boot2docker start

コンテナIDの確認
docker ps -a

コンテナの起動(a83d5e425193以下はそれぞれのID名。複数指定可)
docker start a83d5e425193 b4fb919fc696 268d0271985e e97573b45eba e9d188102538 f87be757fc3d 889cd84266a5

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?