not able to connect to mysql docker from local : <p>I am trying to connect to mysql database from docker image. However it's throwing errors. </p>

<p>following is the docker image I am using. 
<a href="https://hub.docker.com/_/mysql/" rel="noreferrer">https://hub.docker.com/_/mysql/</a></p>

<p>And following is the command I have used to run the docker image. </p>

<pre><code>docker run -p 3306:3306 --name mysql_80 -e MYSQL_ROOT_PASSWORD=password -d mysql:8
</code></pre>

<p>Following is the output of <code>docker ps</code> command </p>

<pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                              NAMES
9f35d2e39476        mysql:8             "docker-entrypoint.s…"   5 minutes ago       Up 5 minutes        0.0.0.0:3306-&gt;3306/tcp
</code></pre>

<p>if I check the IP using docker inspect and ping that IP, it shows IP is not reachable. </p>

<pre><code>docker inspect 9f35d2e39476 | grep -i ipaddress
</code></pre>

<p>And if i try to connect using <code>localhost</code> and <code>127.0.0.1</code> I am getting following error. </p>

<blockquote>
  <p>Unable to load authentication plugin 'caching_sha2_password'.</p>
</blockquote>
