How to get MySql 8 to run with laravel?

When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when caching_sha2_password is not used.

https://www.php.net/manual/en/mysqli.requirements.php

It would also help:

https://php.watch/articles/PHP-7.4-MySQL-8-server-gone-away-fix


Since PHP doesn't understand caching_sha2_password, set the user back to mysql_native_password:

ALTER USER 'forge'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'new_password'