This might seem redundant but I was unable to find a correct solution.
I was unable to login to mysql using the mysql console.It is asking for a password and I have
In the my.ini file in C:\xampp\mysql\bin, add the following line after the [mysqld] command under #Mysql Server:
[mysqld]
#Mysql Server
skip-grant-tables
This should remove the error 1045.