title: exec: \"mysql\": executable file not found in $PATH": unknown
body: <p>I've created a container based on the mysql:5.7 image. Then I set the password with this</p>
  
  <p><code>docker run --name mysql -v $(pwd):/src -e MYSQL_ROOT_PASSWORD=password -d mysql:5.7</code></p>
  
  <p>Then I deployed my modules using docker-compose up -d on my docker-compose.yml file. Apparently, it raised an </p>
  
  <p><code>exec: \"mysql\": executable file not found in $PATH": unknown</code> </p>
  
  <p>error and my 2 other modules also are having errors that keeps on restarting and point to mysql. I can import Python files in Django shell as well as <code>mysql -u root -p</code> but I cannot use the imports when it can't connect to the database.</p>
  
  <p>Things I did based on my research:</p>
  
  <ol>
  <li>I've set my Windows 10 environment variables to point at
  <strong>C:\Program Files\MySQL\MySQL Server 8.0\bin</strong> where mysql.exe resides. It still didn't work.</li>
  <li><p>mysql-init.txt (REF: <a href="https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html</a>): This runs the mysql prompt successfully.</p>
  
  <p><code>grant all privileges on *.* to root@localhost;</code></p>
  
  <p><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';</code></p></li>
  </ol>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: '2'
  services:
    # Mysql
    mysql:
      image: mysql:5.7
      restart: always
      hostname: mysql
      container_name: mysql
      environment:
        - MYSQL_USER=root
        - MYSQL_ROOT_PASSWORD=password
        - MYSQL_DB=bitpal
      ports:
        - "3306:3306"
  
  
    # Redis
    redis:
      image: redis:latest
      restart: always
      hostname: redis
      container_name: redis
      ports:
        - "6379:6379"
  
  
    # Django web server
    bitpal:
      image: python:3.5
      restart: always
      hostname: bitpal
      container_name: bitpal
      working_dir: /bitpal
      command: ./bin/start_dev.sh
      volumes:
        - ./bitpal:/bitpal
        - ./etc/config:/etc/config
        - ./log:/log
      ports:
        - "80:80"
      links:
        - mysql
        - redis
      depends_on:
        - mysql
      environment:
        # Database
        - DB_NAME=bitpal
        - DB_USER=root
        - DB_PASSWORD=password
        - DB_HOST=mysql
        - DB_PORT=3306
  
  
    # Celery worker
    worker:
      image: python:3.5
      restart: always
      container_name: worker
      command: bash -c "./bin/install.sh &amp;&amp; ./bin/celery_worker.sh"
      working_dir: /bitpal
      volumes:
        - ./bitpal:/bitpal
        - ./etc/config:/etc/config
        - ./log:/log
      links:
        - mysql
        - redis
      depends_on:
        - redis
  
  
    # Bitshares websocket listener
    websocket_listener:
      image: python:3.5
      restart: always
      container_name: websocket_listener
      command: bash -c "./bin/install.sh &amp;&amp; ./bin/websocket_listener.sh"
      working_dir: /bitpal
      volumes:
        - ./bitpal:/bitpal
        - ./etc/config:/etc/config
        - ./log:/log
      links:
        - mysql
        - redis
      depends_on:
        - redis
  
  
    # Nginx
    nginx:
      image: nginx:1.12.1
      container_name: nginx
      ports:
        - "8000:80"
      volumes:
        - ./bitpal:/home/bitpal/bitpal/bitpal
        - ./nginx:/etc/nginx/conf.d
      depends_on:
        - bitpal
  </code></pre>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM python:3.5
  
  RUN mkdir -p /bitpal
  
  WORKDIR /bitpal
  EXPOSE 80
  
  ADD requirement.txt /bitpal/
  RUN python3.5 -m pip install -r /bitpal/requirement.txt
  </code></pre>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'bitpal',
          'USER': 'root',
          'PASSWORD': 'password',
          'HOST': SECRETS['db']['default']['hostname'],
          'PORT': '3306',
          'OPTIONS': {'autocommit': SECRETS['db']['default']['commit']}
      }
  }
  </code></pre>
  
  <p><strong>docker version</strong></p>
  
  <pre><code>Client:
   Version:       18.03.0-ce
   API version:   1.37
   Go version:    go1.9.4
   Git commit:    0520e24
   Built: Wed Mar 21 23:06:28 2018
   OS/Arch:       windows/amd64
   Experimental:  false
   Orchestrator:  swarm
  
  Server:
   Engine:
    Version:      18.04.0-ce
    API version:  1.37 (minimum version 1.12)
    Go version:   go1.9.4
    Git commit:   3d479c0
    Built:        Tue Apr 10 18:23:35 2018
    OS/Arch:      linux/amd64
    Experimental: false
  </code></pre>
  
  <p><strong>docker info</strong></p>
  
  <pre><code>Containers: 6
   Running: 3
   Paused: 0
   Stopped: 3
  Images: 6
  Server Version: 18.04.0-ce
  Storage Driver: aufs
   Root Dir: /mnt/sda1/var/lib/docker/aufs
   Backing Filesystem: extfs
   Dirs: 46
   Dirperm1 Supported: true
  Logging Driver: json-file
  Cgroup Driver: cgroupfs
  Plugins:
   Volume: local
   Network: bridge host macvlan null overlay
   Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
  Swarm: inactive
  Runtimes: runc
  Default Runtime: runc
  Init Binary: docker-init
  containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
  runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
  init version: 949e6fa
  Security Options:
   seccomp
    Profile: default
  Kernel Version: 4.9.93-boot2docker
  Operating System: Boot2Docker 18.04.0-ce (TCL 8.2.1); HEAD : b8a34c0 - Wed Apr 11 17:00:55 UTC 2018
  OSType: linux
  Architecture: x86_64
  CPUs: 1
  Total Memory: 995.6MiB
  Name: default
  ID: I7DZ:5SQN:EOBV:PJOE:YHNK:RSXK:F6EH:4J7P:LSTI:CR2M:E2MV:VI27
  Docker Root Dir: /mnt/sda1/var/lib/docker
  Debug Mode (client): false
  Debug Mode (server): false
  Registry: https://index.docker.io/v1/
  Labels:
   provider=virtualbox
  Experimental: false
  Insecure Registries:
   127.0.0.0/8
  Live Restore Enabled: false
  </code></pre>
  
  <p><strong>docker inspect mysql:5.7</strong></p>
  
  <pre><code>[
      {
          "Id": "sha256:0d16d0a97dd13a8ca0c0e205ce1f31f64d9d32048379eb322749442bff35f144",
          "RepoTags": [
              "mysql:5.7"
          ],
          "RepoDigests": [
              "mysql@sha256:f030e84582d939d313fe2ef469b5c65ffd0f7dff3b4b98e6ec9ae2dccd83dcdf"
          ],
          "Parent": "",
          "Comment": "",
          "Created": "2018-05-04T23:41:21.907294662Z",
          "Container": "7fed895363c6e67ba9d52eaea107a1267d63e2d5ad46c567926d6897c7175624",
          "ContainerConfig": {
              "Hostname": "7fed895363c6",
              "Domainname": "",
              "User": "",
              "AttachStdin": false,
              "AttachStdout": false,
              "AttachStderr": false,
              "ExposedPorts": {
                  "3306/tcp": {}
              },
              "Tty": false,
              "OpenStdin": false,
              "StdinOnce": false,
              "Env": [
                  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                  "GOSU_VERSION=1.7",
                  "MYSQL_MAJOR=5.7",
                  "MYSQL_VERSION=5.7.22-1debian9"
              ],
              "Cmd": [
                  "/bin/sh",
                  "-c",
                  "#(nop) ",
                  "CMD [\"mysqld\"]"
              ],
              "ArgsEscaped": true,
              "Image": "sha256:71f4997ae44aead33eefe93100990253bca456f7b63dc5aad5baa936e7c14c46",
              "Volumes": {
                  "/var/lib/mysql": {}
              },
              "WorkingDir": "",
              "Entrypoint": [
                  "docker-entrypoint.sh"
              ],
              "OnBuild": [],
              "Labels": {}
          },
          "DockerVersion": "17.06.2-ce",
          "Author": "",
          "Config": {
              "Hostname": "",
              "Domainname": "",
              "User": "",
              "AttachStdin": false,
              "AttachStdout": false,
              "AttachStderr": false,
              "ExposedPorts": {
                  "3306/tcp": {}
              },
              "Tty": false,
              "OpenStdin": false,
              "StdinOnce": false,
              "Env": [
                  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                  "GOSU_VERSION=1.7",
                  "MYSQL_MAJOR=5.7",
                  "MYSQL_VERSION=5.7.22-1debian9"
              ],
              "Cmd": [
                  "mysqld"
              ],
              "ArgsEscaped": true,
              "Image": "sha256:71f4997ae44aead33eefe93100990253bca456f7b63dc5aad5baa936e7c14c46",
              "Volumes": {
                  "/var/lib/mysql": {}
              },
              "WorkingDir": "",
              "Entrypoint": [
                  "docker-entrypoint.sh"
              ],
              "OnBuild": [],
              "Labels": null
          },
          "Architecture": "amd64",
          "Os": "linux",
          "Size": 371961246,
          "VirtualSize": 371961246,
          "GraphDriver": {
              "Data": null,
              "Name": "aufs"
          },
          "RootFS": {
              "Type": "layers",
              "Layers": [
                  "sha256:d626a8ad97a1f9c1f2c4db3814751ada64f60aed927764a3f994fcd88363b659",
                  "sha256:0fea3c8895d3871f5c577987f09735ae0889811efbad0dfde4d57851a4d40c00",
                  "sha256:ed9fd767a1ff316e1a5896e150cede3ba2bcfe406d2135a6bc6306295cc479af",
                  "sha256:f9dfc87a2e756c25245847a95ced53a6c065405b417d7635a28aa88235b30786",
                  "sha256:5081cf9eb26642b5373aaa6eea7e16b6caefc3a495cf8fa0f296df48d8651f2f",
                  "sha256:0404d129c384e4f45e5ae6a8d89c388a323bc0dda82ea45c6e4d0a442ea1e4b0",
                  "sha256:98bb41f25d3307bc5c124529cfde7c3c27a0d612d918e91a36fc1e852e2e629c",
                  "sha256:c11f67aad663de23cb77fbbbc6f7bee656e95e72cc820733aed6430a618738ab",
                  "sha256:d2f1dc45f8bf45758eee7bc59fe94e9f251c415ef8d08540529d1a004772ee9e",
                  "sha256:01df4e5c105921d20d800c1250c66009d472eb5628817bfa2c9523df5c53e03c",
                  "sha256:4f840ea0733fe23b9fda79ff521a2e6e8112a615df5db064570502af19c08511"
              ]
          },
          "Metadata": {
              "LastTagTime": "0001-01-01T00:00:00Z"
          }
      }
  ]
  </code></pre>