title: Unable to login into phpmyadmin
body: <p>I'm using a mac and recently installed phpmyadmin and mysql. While trying to login using root on <a href="http://localhost/~Shreyas/phpmyadmin/" rel="nofollow noreferrer">http://localhost/~Shreyas/phpmyadmin/</a> I get the following errors. </p>
  
  <blockquote>
    <p>Cannot log in to the MySQL server</p>
    
    <p>mysqli_real_connect(): The server requested authentication method
    unknown to the client [caching_sha2_password]</p>
    
    <p>mysqli_real_connect(): (HY000/2054): The server requested authentication 
    method unknown to the client</p>
  </blockquote>
  
  <p>In the config.inc.php file I tried changing </p>
  
  <pre><code>$cfg['Servers'][$i]['host'] = 'localhost';
  </code></pre>
  
  <p>to,</p>
  
  <pre><code>$cfg['Servers'][$i]['host'] = '127.0.0.1';
  </code></pre>
  
  <p>I then got the following error.</p>
  
  <blockquote>
    <p>mysqli_real_connect(): (HY000/2002): Connection refused</p>
  </blockquote>
  
  <p>I even added this line:</p>
  
  <blockquote>
    <p>$cfg['Servers'][$i]['AllowNoPassword'] = true;</p>
  </blockquote>
  
  <p>I tried the following links but none of the answers mentioned seemed to work. I also changed the port to 3307 and 3306. None of them worked.</p>
  
  <p><a href="https://stackoverflow.com/questions/27905049/php-warning-mysqli-connect-hy000-2002-connection-refused">PHP Warning: mysqli_connect(): (HY000/2002): Connection refused</a>
  `</p>
  
  <p><a href="https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0">phpMyAdmin on MySQL 8.0</a></p>
  
  <p>This is my first attempt at php and mysql. Any help is appreciated.</p>
  
  <p>EDIT: I uninstalled mysql and re-installed it. Now it works.</p>