PHP mysqli_connect authentication caching_sha2_password

I recently had a database with the latest MySQL which does not use the traditional mysql_native_password so I had to alter my user via the terminal to change the type.

Below I will list the changes you can do to fix the database and be able to connect

error: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in...

SQL Command to Alter User

ALTER USER 'mysqlUsername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysqlUsernamePassword';

SQL Command to Create a New User

 CREATE USER 'jeffrey'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';