mysql grant privileges get error 1133(42000):在用户表中找不到任何匹配的行

zbq4xfa0  于 2021-06-20  发布在  Mysql
关注(0)|答案(10)|浏览(373)

我正试图将priv授予我的django用户,但出现了一个错误,即在user表中找不到任何匹配的行。它是用户表。 `mysql> select user,grant_priv from user; +

b4qexyjb

b4qexyjb1#

  • | information_schema | | django | | my_First_Django | | mysql | | performance_schema | | sys | +
4jb9z9bj

4jb9z9bj3#

--+这是数据库。mysql> show databases; +

q7solyqu

q7solyqu5#

从根用户运行:

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)
anauzrmj

anauzrmj6#

--+ | root | Y | | mysql.session | N | | mysql.sys | N | | django | N | +

qxgroojn

qxgroojn7#

--+ | user | grant_priv | +

fkaflof6

fkaflof68#

+我使用下面的代码得到了错误。mysql> grant all privileges on django.* to django@localhost identified by ''; ERROR 1133 (42000): Can't find any matching row in the user table顺便说一句,我试过了FLUSH PRIVILEGES;` 也一样,不工作。
有人帮忙吗?谢谢!

相关问题