Check out example codes for "django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'")". It will help you in understanding the concepts better.

Code Example 1

create user 'django'@'localhost' identified by 'django-user-password';
grant usage on *.* to 'django'@'localhost';
grant all privileges on django-database-1.* to 'django'@'localhost';

Learn ReactJs, React Native from akashmittal.com