I'm trying to make Mysql and phpMyAdmin works.
I installed mysql using brew
Following those answers https://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
I tried to set a plain text password
UPDATE mysql.user SET authentication_string='root' WHERE User='root';
But now when I try to login into phpmyadmin I get 2 errors (I'm not able to connect even with mysql
cli with "Access denied" error):
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
Best Answer
I got the problem, basically almost all the solution you can find around are outdated. With mysql 8.0.15 you have to follow this guide https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
I recommend to read the whole page, but basically you have to use
NOTE Using the method
UPDATE mysql.user SET authentication_string..
will lock you out from your own mysql server (you won't solve even withmysqld_safe --skip-grant-tables
). If you end up locked out, I guess the only hope (I didn't test it) is to stopmysqld
and relaunchmysqld
manually using--init-file="myinitfile"
wheremyinitfile
is a plain text file containing theALTER USER
instruction I mentioned before (I'm not sure it is even doable if you have installedmysql
usingbrew
, but note I'm new to macOS). Mine was a fresh installation, so I've just deleted the whole/usr/local/var/mysql
directory and reinstalled mysql.