Description:
After creating a database with
mysqladmin -uroot create monitorsr
And creating a user with
GRANT ALL PRIVILEGES
ON monitorsr.*
TO monitor@'%'
IDENTIFIED BY 'monitor';
When trying to connect to the local database server from the shell I get an error:
looser@duron$ mysql -umonitor -pmonitor monitorsr
ERROR 1045 (28000): Access denied for user 'monitor'@'localhost' (using password: YES)
The same happens when not saying which database I want to use:
looser@duron$ mysql -umonitor -pmonitor
ERROR 1045 (28000): Access denied for user 'monitor'@'localhost' (using password: YES)
The corresponding database tables don't contain any special things, so i doubt this is either a documentation bug or a bug in mysql itself.
mysql> select * from db where db = 'monitorsr';
+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv |
+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| % | monitorsr | monitor | Y | Y | Y | Y | Y | Y | N | Y | Y | Y | Y | Y |
+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
1 row in set (0.00 sec)
mysql> select * from user where user = 'monitor';
+------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections |
+------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
| % | monitor | *1975D095AC033CAF4E1BF94F7202A9BBFEEB66F1 | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 |
+------+---------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
1 row in set (0.00 sec)
Of course I checked for any typos.
How to repeat:
Do the same like described above