MySQL ERROR (1045, "Access denied for user '_efec46ab9f8187b1'@'localhost' (using password: YES)")

I have been 3 days stuck on this I do not know what I have done wrong it won’t connect to Mysql…
please reply fast I have done a lot in this project i don’t want to start all over again
regards
saif sabry

@saifsabry check this pymysql.err.OperationalError - (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

I tired to put these commands after loging in with MYSQL
@Jeel

> 
> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
> FLUSH PRIVILEGES;
> EXIT;

it did not work