title: Yii2 advanced on docker
body: <p>I have yii2 advanced application on docker, mysql db does not work.</p>
  
  <p>My docker-compose:</p>
  
  <pre><code>db:
    image: 'mysql:latest'
    volumes:
        - ./database:/var/lib/mysql
    ports:
        - '3306:3306'
    restart: always
    environment:
       MYSQL_ROOT_PASSWORD: pass
       MYSQL_DATABASE: database
  </code></pre>
  
  <p>db in yii2:</p>
  
  <pre><code>return =&gt; [
          'class' =&gt; 'yii\db\Connection',
          'dsn' =&gt; 'mysql:host=127.0.0.1;port=3306;dbname=database',
          'username' =&gt; 'root',
          'password' =&gt; 'pass',
          'charset' =&gt; 'utf8',
      ],
  </code></pre>
  
  <p>When i go on my local folder with yii2 and go <code>php yii migrate</code> i see <code>Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client'</code></p>
  
  <p>How fix my pronblem?</p>
  
  <p>All code <a href="https://github.com/k0v4back/docker-yii2" rel="nofollow noreferrer">https://github.com/k0v4back/docker-yii2</a></p>