Can't connect laravel to managed mysql (Error 2054 (HY000) The server requested authentication method unknown to the client)

Posted October 14, 2020 3k views
DigitalOcean Managed MySQL DatabaseLaravel

I am trying to connect my laravel app (currently on my Mac) to my managed mysql db. My IP is entered as a trusted source. I was getting a different error until I followed the tutorial and used the flags connection script to connect. Now I geterror: 2054 The server requested authentication method unknown to the client.

I am connecting as follows:

DB_URL="mysql -u my_username -p my_password -h -P 25060 -D IHC"

How on earth do I connect this thing?

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

The only other thing I saw that might help is this:

Having trouble connecting? Your MySQL client might not support the new MySQL 8 default password encryption. If you're experiencing issues with the Default (caching_sha2_password), change the mode to Legacy (mysql_native_password).

I don’t know how to do this.

OOOOH!!! I got it! I had to create a new user, but with MySQL 5 settings, and get rid of the following lines (for anyone else having this issue):