This is a tricky one, I have the following output:
mysqldump: Got error: 1045: Access denied for user \'root\'@\'localhost\' (using password: YES) when tr
I was having the same issue, for 30min! I found that I was using _p instead of -p, the terminal font confused me!
_p
-p