Hello friend, I had the same problem when I installed phpmyadmin after formatting my pc, the solution is simple if at the moment of installing and you try to login and you get the following error: **mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'**
you must open a terminal in my case, I use linux but you can also in windows, and you must give permissions to a new user to phpmyadmin in the following way:
enter this line of code in the terminal
sudo mysql -p -u root
he will ask for a password, in my case he will not enter anything.
followed by this line in the terminal
CREATE USER 'newuser'@'%' IDENTIFIED BY 'you_password_here';
He should give you a result similar to this one
Query OK, 0 rows affected (0.00 sec)
then you apply the following line of code that is to give privileges to this new user
**'GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%' WITH GRANT OPTION;'**
will give you an answer like this:
Query OK, 0 rows affected (0.01 sec)
and ready.