I'm using a mac and recently installed phpmyadmin and mysql. While trying to login using root on http://localhost/~Shreyas/phpmyadmin/ I get the following errors.
Cannot log in to the MySQL server
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client
In the config.inc.php file I tried changing
$cfg['Servers'][$i]['host'] = 'localhost';
to,
$cfg['Servers'][$i]['host'] = '127.0.0.1';
I then got the following error.
mysqli_real_connect(): (HY000/2002): Connection refused
I even added this line:
$cfg['Servers'][$i]['AllowNoPassword'] = true;
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.
PHP Warning: mysqli_connect(): (HY000/2002): Connection refused `
This is my first attempt at php and mysql. Any help is appreciated.
EDIT: I uninstalled mysql and re-installed it. Now it works.