title: MySQL in Docker returns "The server requested authentication method unknown to the client"
body: <p>I use a Docker web stack for Symfony 4 project. MySQL configuration is :</p>
  
  <pre><code>mysql:
      image: mysql
      container_name: sf4_mysql
      volumes:
          - .docker/data/db:/var/lib/mysql
      environment:
          MYSQL_ROOT_PASSWORD: root
          MYSQL_DATABASE: ***
          MYSQL_USER: ***
          MYSQL_PASSWORD: ***
  </code></pre>
  
  <p>The pulled image from Docker Hub is MySQL 8 and when I tried to create database with <code>doctrine:database:create</code> I received this message : </p>
  
  <blockquote>
    <p>2018-09-17T11:53:51+00:00 [error] Error thrown while running command "doctrine:database:create". Message: "An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication me
    thod unknown to the client"</p>
    
    <p>In AbstractMySQLDriver.php line 126:</p>
    
    <p>An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client</p>
    
    <p>In PDOConnection.php line 50:</p>
    
    <p>SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client</p>
    
    <p>In PDOConnection.php line 46:</p>
    
    <p>SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client</p>
    
    <p>In PDOConnection.php line 46:</p>
    
    <p>PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]</p>
  </blockquote>