MySQL seems to ignore --host argument

You are misunderstanding the error, it is saying that the user username connecting from host1 was denied access. The error comes from host2.


The error is actually saying "You're trying to use username from host1".

You'll need to add permissions for username on host1. Can you post SHOW GRANTS FOR 'username' from while logged into MySQL as root on host2?

Edit: Ninja'd :)