There's an elephant in the room:
Quote:1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect
Your mysqldump application still tries to login as MySQL root instead of the user you specified. So there must be something wrong with the command. If e.g. the password is wrong the error should look like the one below.
Command:
mysqldump -u dbuser -p'dbpasswordwrong' testdb >testdb.sql
Result:
mysqldump: Got error: 1045: Access denied for user 'dbuser'@'localhost' (using password: YES) when trying to connect
A correct password will simply create the database .sql dump without any error messages or similar.
Compare your command with mine and you will see major differences.