Using MySQL v5.1.52
After creating a mysql user with the following commands:
create user 'user1'@'%' identified by 'pass1';
grant select on db1.* to 'user1';
flush privileges;
Then doing a 'mysql -uuser1 -p' in the command line then entering the password I still get this error:
Enter password:
ERROR 1045 (28000): Access denied for user 'user1'@'localhost' (using password: YES)
However when connecting from a remote system (with the -h) to the above server using the above credentials it works.
Why can I not log on locally with this user?
Here is the user/host outpout:
mysql> select User,Host from mysql.user;
+----------------+-----------------+
| User | Host |
+----------------+-----------------+
| user1 | % |