The accepted answer saved me (thanks, Bill!!!), but I ran into another related issue, just wanted to provide some details on my experience -
After upgrading to MySQL 8.0.11, I experienced the same problem as the OP when using PHP's mysqli_connect()
function. In my MySQL directory (in my case, usr/local/mysql
), I created the my.cnf
file, added the content in the accepted answer, then restarted the MySQL server. However, this produced a new error:
mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
I added the line default_authentication_plugin = mysql_native_password
, so my.cnf
now looked like:
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
default_authentication_plugin = mysql_native_password
and I was good to go!
For additional reference: https://github.com/laradock/laradock/issues/1392