Reputation: 75
I am trying to grant priv to my django user, but I got error says can't find any matching row in the user table.
It is the user table.
mysql> select user,grant_priv from user;
+---------------+------------+
| user | grant_priv |
+---------------+------------+
| root | Y |
| mysql.session | N |
| mysql.sys | N |
| django | N |
+---------------+------------+
Here is databases.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| django |
| my_First_Django |
| mysql |
| performance_schema |
| sys |
+--------------------+
I used code below and got the error.
mysql> grant all privileges on django.* to django@localhost identified by '';
ERROR 1133 (42000): Can't find any matching row in the user table
btw I tried FLUSH PRIVILEGES;
as well, and not work.
Anyone help? Thanks!
Upvotes: 3
Views: 9200
Reputation:
Run from Root user:
grant all privileges on django.* to 'django'@'localhost' identified by '';
mysql> grant all privileges on testdb1.* to 'user1'@'localhost' identified by 'user1'; Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
Upvotes: 6