In a test environment, I created a user and a DB with the same name this way:
create user 'test'@'localhost' identified by 'blablabla'; create database test;
When I came to associate the user with the DB (while also granting all privileges to the user) this way:
grant all privileges on test.* to test;
I got this error:
ERROR 1133 (42000): Can't find any matching row in the user table
I don't understand what doesn't match. Because
show databases; and
SELECT user FROM mysql.user; clues that both the user and DB were created successfully, I miss why I get this error.
Why do I get this error?
Update for Abhik Bose:
mysql> grant all privileges on test.* to 'test'@'localhost'; grant all privileges on test.* to 'test'@'localhost'; ^C mysql> grant all privileges on test.* to 'test'@'localhost'; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 4774 Current database: *** NONE *** Query OK, 0 rows affected (0.00 sec)