MySQL:无法访问information_schema

8
当我创建新用户或给现有用户授予权限时,我遇到了这个错误:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

除了information_schema表之外,我希望您能授予所有表的权限,但在这个表上,我遇到了访问被拒绝的错误。我该如何解决?是将所有数据库转储、删除所有数据库,然后从备份中还原吗?


2
你没有执行 FLUSH PRIVILEGES; 或者赋予了错误的权限。 - Daniel W.
mysql> grant all privileges on . to 'root'@'localhost' with grant option; 错误 1045 (28000):用户'root'@'localhost'访问被拒绝(使用密码:YES) mysql> grant all privileges on some_db.* to 'root'@'localhost' with grant option; 查询 OK,0 行记录受影响(0.00 秒) - aranel
3个回答

5

MySQL文档中提到:

... 您只能读取表的内容,而不能对其执行INSERT、UPDATE或DELETE操作。


它们是视图而不是基本表。 - Paul Campbell

3

1
请注意,如果您在名称information_schema中有拼写错误,您也会收到一个denied to user消息。这有时会令人困惑。
select * from bogusSchema.bogusTable;

错误会是:
Error Code: 1142. SELECT command denied to user 'user123'@'localhost' for table 'bogusTable'

我正在使用的是 MySQLInfoBright 变种。不确定其他变种/版本的 MySQL 是否存在相同的问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接