Mysql access denied error for user root@localhost in XAMPP

| By Webner

Problem: Mysql access denied error for user root@localhost when using in XAMPP server (windows) even when credentials are correct. Solution: Actually the problem is not in code, the issue is that by-default mysql in xampp allowed passwordless authentication in mysql, so