title: Laravel Linux Centos EC2 Mysql access denied
body: <p>Currently this is my <code>mysql -u root -p</code> credential</p>
  
  <p><code>UN : root</code></p>
  
  <p><code>Pass:1234</code></p>
  
  <p>So I have this <code>.env</code> config on my server</p>
  
  <pre><code> DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=sampledb
   DB_USERNAME=root
   DB_PASSWORD=1234
  </code></pre>
  
  <p>in Mysql I have these <code>SELECT user, host FROM mysql.user;</code></p>
  
  <p><a href="https://i.stack.imgur.com/adpG1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/adpG1.png" alt="enter image description here"></a></p>
  
  <p>the root user has the all privileges</p>
  
  <p>I tried to restart my apache &amp; mysql</p>
  
  <p>also tried to <code>flush privileges</code> to take effect the privileges of the root user</p>
  
  <p>also tried to</p>
  
  <pre><code>  php artisan config:clear
    php artisan view:clear
    php artisan cache:clear
  </code></pre>
  
  <p>But the problem is I'm still getting the error of <code>SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost'</code></p>