Silly question but I have added new user to mysql database and granted all privileges to it but still when I try to log into mysql I've got access denied.
I've performed this steps after I've logged in as a root
mysql> CREATE USER 'myuser'@'%' IDENTIFIED BY '123321';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'localhost';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'%';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'127.0.0.1';
mysql> FLUSH PRIVILEGES;
When I run
mysql> select User,Host from mysql.user;
the result is
+----------+-----------+
| User | Host |
+----------+-----------+
| myuser | % |
| mysql | % |
| myuser | 127.0.0.1 |
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| myuser | localhost |
| root | localhost |
+----------+-----------+
When I try to log with the command
mysql -u myuser -p123321
The error is that access is denied and password used: Yes.
ERROR 1045 (28000): Access denied for user 'myuser'@'localhost' (using password: YES)