Check out example codes for "mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)". It will help you in understanding the concepts better.

Code Example 1

alter user 'root'@'localhost' identified with mysql_native_password by 'password';

Learn ReactJs, React Native from akashmittal.com