I have created a user and given that user full access, but MySQL is still denying access to that user - why?
Create user:
create user 'myUser'@'Mikes-MacBook-Air.local' identified by 'account_password'
Grant privileges to all databases:
grant all privileges on *.* to 'myUser'@'Mikes-MacBook-Air.local' identified by 'account_password' with grant option
Verified grant:
show grants for 'myUser'@'Mikes-MacBook-Air.local'
MySQL is running (verified) on a machine with IP 192.168.0.2 and the client is connection from a machine with IP 192.168.0.3. I have even created a user account with the ip as the domain:
Create user:
create user 'myUser'@'192.168.0.3' identified by 'account_password'
Grant privileges to all databases:
grant all privileges on *.* to 'myUser'@'192.168.0.3' identified by 'account_password' with grant option
Verified grant:
show grants for 'myUser'@'192.168.0.3'
I have rebooted both machines and verified IP addresses did not change and that MySQL is running. I can access this MySQL server from Workbench w/o issue from the same client machine - different credentials though. I can also access this MySQL instance from another remote client machine, where user has similar MySQL account with other computer domain.
After all this, I still get the exception:
Exception: Access denied for user 'myUser'@'Mikes-MacBook-Air.local' (using password: YES)
Why is MySQL denying access?
It's trying to connect using the username 'Mikes-MacBook-Air.local' instead of 'myUser'. What is the exact command you're using to connect when you're receiving the error message?
do you have skip-resolv in your my.cnf ? If so MySQL will not check ACL with hostnames.
In general, avoid using hostnames in MySQL ACL and always use IP or network. Then add skip-resolv in your configuration, you will have better connection performance.