Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Created July 20, 2017 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihirokaasan/b769959dd0c736a3be36b9f7f586e026 to your computer and use it in GitHub Desktop.
Save chihirokaasan/b769959dd0c736a3be36b9f7f586e026 to your computer and use it in GitHub Desktop.
MySQLコンテナにアクセス
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
095c263fb06d mysql:5.7 "docker-entrypoint..." 25 hours ago Up 25 hours 0.0.0.0:3306->3306/tcp sample-mysql
$ docker exec -it 095c263fb06d bash
root@095c263fb06d:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment