title: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) . DB_HOST set to localhost
body: <p>I moved the Laravel project from localhost to server. Which I have done every step on the server.</p>
  <p>I am able to view the login page on my server. The problem is I am not able to connect with my MySQL server.</p>
  <p>My <code>.env</code> file:</p>
  <pre class="lang-none prettyprint-override"><code>APP_NAME=Transport
  APP_ENV=local
  APP_KEY=base64:mrakeyidharhaikonsdf
  APP_DEBUG=true
  APP_URL=http://localhost
  
  LOG_CHANNEL=stack
  
  DB_CONNECTION=mysql
  DB_HOST=localhost
  DB_PORT=3306
  DB_DATABASE=transport_db
  DB_USERNAME=root
  DB_PASSWORD=mypass
  </code></pre>
  <p>I tried to change the host to <code>127.0.0.1</code> and also tried to put my server's IP address. It didn't helped me. Am I missing something?</p>
  <p>My error:</p>
  <blockquote>
  <p>SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select count(*) as aggregate from <code>users</code> where <code>email</code> = user.email@gmail.com)</p>
  </blockquote>
  <p><sub>I know this question may have answers already on Stack Overflow. But I have different issue here.</sub></p>