title: SQLSTATE[HY000] [1045] Access denied for user 'symfony'@'localhost' (using password: YES) ----- docker
body: <p><a href="https://i.stack.imgur.com/gaPZd.png" rel="nofollow noreferrer">error</a></p>
  <p>error:</p>
  <p>In AbstractMySQLDriver.php line 112:</p>
  <p>An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'symfony'@'localhost' (usin<br />
  g password: YES)</p>
  <p>In Exception.php line 18:</p>
  <p>SQLSTATE[HY000] [1045] Access denied for user 'symfony'@'localhost' (using password: YES)</p>
  <p>In PDOConnection.php line 38:</p>
  <p>SQLSTATE[HY000] [1045] Access denied for user 'symfony'@'localhost' (using password: YES)</p>
  <p>.env : DATABASE_URL=mysql://symfony:symfony@127.0.0.1:3306/symfony?serverVersion=5.7</p>
  <p>docker setup: docker-compose.yml</p>
  <pre><code> db:
          container_name: db
          image: 'mysql:8.0'
          command: [&quot;--default-authentication-plugin=mysql_native_password&quot;]
          ports:
              - &quot;3306:3306&quot;
          environment:
              MYSQL_ROOT_PASSWORD: root
              MYSQL_DATABASE: symfony
              MYSQL_USER: symfony
              MYSQL_PASSWORD: symfony
              DATABASE_URL: symfony.localhost
          networks:
              - db
  </code></pre>