Check out example codes for "mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]". It will help you in understanding the concepts better.

Code Example 1

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

Learn ReactJs, React Native from akashmittal.com