SpringCloud實戰項目全套學習教程連載中html
面試刷題
的開源系統,能夠用零碎時間利用小程序查看常見面試題,夯實Java基礎。sudo docker pull mysql:5.7
ubuntu@VM-0-13-ubuntu:~$ sudo docker pull mysql:5.7 5.7: Pulling from library/mysql c499e6d256d6: Pull complete 22c4cdf4ea75: Pull complete 6ff5091a5a30: Pull complete 2fd3d1af9403: Pull complete 0d9d26127d1d: Pull complete 54a67d4e7579: Pull complete fe989230d866: Pull complete 466a91a95e2f: Pull complete 3e4554c238f1: Pull complete 603b48ead88c: Pull complete 1e86a9aa7171: Pull complete Digest: sha256:fbaeced79cfdae5d3c8d4a8c41e883f254f72ed7428c6b93a498824b76d97121 Status: Downloaded newer image for mysql:5.7 docker.io/library/mysql:5.7
sudo docker images
sudo docker run -p 3306:3306 --name mysql \ -v /mydata/mysql/log:/var/log/mysql \ -v /mydata/mysql/data:/var/lib/mysql \ -v /mydata/mysql/conf:/etc/mysql \ -e MYSQL_ROOT_PASSWORD=root \ -d mysql:5.7 參數說明 -p 3306:3306 將容器的3306端口映射到主機 -v /mydata/mysql/log:/var/log/mysql\ 將日誌文件掛載到主機 -v /mydata/mysql/data:/var/lib/mysql\ 將數據文件掛載到主機 -v /mydata/mysql/conf:/etc/mysql\ 將配置文件掛載到主機
mysql容器已啓動mysql
sudo docker exec -it mysql /bin/bash
cd /mydata/mysql ls