Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 974 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 974 Bytes

mysql-docker-compose

A docker-compose sample to start MySQL database.

How to use?

  1. Clone the project:
  $ git clone https://github.com/gaoshanyu/mysql-docker-compose.git
  1. Start MySQL via docker-compose in terminal:
  $ cd ./mysql-docker-compose
  // Please add path "/usr/local/var/mysql" as the sharing folder for your Docker before
  $ docker-compose up -d
  1. Connect to the MySQL server:
  # Enter in the docker container
  $ docker exec -it mysql bash
  # Connect to mysql service, and enter in password 12345678
  $ mysql -h 127.0.0.1 -u root -P 3306 -p
  1. Other commands maybe needed:
  # you can stop service by the command
  $ docker stop mysql
  # you can start service by the command
  $ docker start mysql
  # you can restart service by the command
  $ docker restart mysql