title: Unable to connect to MYSQL from Docker Instance
body: <p>I'm new to <code>Docker</code> and pulled the <code>mysql</code> from the <strong>docker hub</strong> using following command</p>
  
  <pre><code>docker pull mysql
  </code></pre>
  
  <p>Now, started <code>mysql</code> instance using following commands.</p>
  
  <pre><code>docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql/mysql-server:latest
  Unable to find image 'mysql/mysql-server:latest' locally
  latest: Pulling from mysql/mysql-server
  
  e64f6e679e1a: Pull complete
  799d60100a25: Pull complete
  85ce9d0534d0: Pull complete
  d3565df0a804: Pull complete
  Digest: sha256:59a5854dca16488305aee60c8dea4d88b68d816aee627de022b19d9bead48d04
  Status: Downloaded newer image for mysql/mysql-server:latest
  1be4f5dde2fb4e1d99e23ee2de5e3b663c7c2d0fabe7ef459cf87385071a2e0d
  </code></pre>
  
  <p>Now, I've checked what all services are up and running.</p>
  
  <pre><code>docker ps
  CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                   PORTS                               NAMES
  1be4f5dde2fb        mysql/mysql-server:latest   "/entrypoint.sh mysql"   3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql
  e7d9e3713f5c        ubuntu                      "/bin/bash"              6 days ago          Up 6 days                                                    angry_hodgkin
  </code></pre>
  
  <p>and now I execute the following commands and unable to connect to mysql - </p>
  
  <pre><code>mysql -h127.0.0.1 -ppassword -uroot
  -bash: mysql: command not found
  </code></pre>
  
  <p>Docker version..</p>
  
  <pre><code>docker --version
  Docker version 1.12.3, build 6b644ec
  </code></pre>
  
  <p><em>Now, I'm getting below erro - EDIT-1</em></p>
  
  <pre><code>docker exec -it 1be4f5dde2fb bash
  bash-4.2# mysql
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
  bash-4.2# sudo mysql
  bash: sudo: command not found
  </code></pre>
  
  <p><a href="https://hub.docker.com/r/mysql/mysql-server/" rel="noreferrer">https://hub.docker.com/r/mysql/mysql-server/</a></p>