mac docker 安装mysql
作者:互联网
ivys-MacBook-Pro:~ txp$ cd ivys-MacBook-Pro:~ txp$ ls Desktop IdeaProjects Music flagship Documents Library Pictures mysql Downloads Movies Public ivys-MacBook-Pro:~ txp$ cd mysql/ ivys-MacBook-Pro:mysql txp$ ls data ivys-MacBook-Pro:mysql txp$ mkdir -p conf ivys-MacBook-Pro:mysql txp$ ls conf data ivys-MacBook-Pro:mysql txp$ cd conf ivys-MacBook-Pro:conf txp$ ls ivys-MacBook-Pro:conf txp$ mkfile docker.cnf usage: mkfile [-nv] size[b|k|m|g] filename ... ivys-MacBook-Pro:conf txp$ ls ivys-MacBook-Pro:conf txp$ mkfile -n docker.cnf usage: mkfile [-nv] size[b|k|m|g] filename ... ivys-MacBook-Pro:conf txp$ mkfile -n 1mb docker.cnf ivys-MacBook-Pro:conf txp$ ls docker.cnf ivys-MacBook-Pro:conf txp$ mkfile -n 1mb mysql.cnf ivys-MacBook-Pro:conf txp$ mkfile -n 1mb mysqldump.cnf ivys-MacBook-Pro:conf txp$ ls docker.cnf mysql.cnf mysqldump.cnf ivys-MacBook-Pro:conf txp$ touch docker.cnf ivys-MacBook-Pro:conf txp$ vim docker.cnf ivys-MacBook-Pro:conf txp$ ls docker.cnf mysql.cnf mysqldump.cnf ivys-MacBook-Pro:conf txp$ vim mysql.cnf ivys-MacBook-Pro:conf txp$ touch mysql.cnf ivys-MacBook-Pro:conf txp$ touch mysql.cnf -100 ivys-MacBook-Pro:conf txp$ vim mysqldump.cnf ivys-MacBook-Pro:conf txp$ docker run -d --name mysql57 --net=backend -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -v /mysql/data:/var/lib/mysql -v /mysql/conf:/etc/mysql/conf.d mysql:5.7.21 Unable to find image 'mysql:5.7.21' locally 5.7.21: Pulling from library/mysql 2a72cbf407d6: Pull complete 38680a9b47a8: Pull complete 4c732aa0eb1b: Pull complete c5317a34eddd: Pull complete f92be680366c: Pull complete e8ecd8bec5ab: Pull complete 2a650284a6a8: Pull complete 5b5108d08c6d: Pull complete beaff1261757: Pull complete c1a55c6375b5: Pull complete 8181cde51c65: Pull complete Digest: sha256:691c55aabb3c4e3b89b953dd2f022f7ea845e5443954767d321d5f5fa394e28c Status: Downloaded newer image for mysql:5.7.21 0d07ab9cdd252f73b92c39be112842567fa8d8a15ef4259d2565da0c617ef36d docker: Error response from daemon: Mounts denied: The path /mysql/data is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing. See https://docs.docker.com/desktop/mac for more info. ivys-MacBook-Pro:conf txp$ open mysql The file /Users/txp/mysql/conf/mysql does not exist. ivys-MacBook-Pro:conf txp$ cd ~/ ivys-MacBook-Pro:~ txp$ open mysql ivys-MacBook-Pro:~ txp$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql 5.7.21 5195076672a7 4 years ago 371MB
标签:Pro,ivys,mac,conf,mysql,docker,MacBook,txp 来源: https://www.cnblogs.com/duwamish/p/16370518.html