错误1142:SELECT和LOCK TABLE命令被拒绝 [英] Error 1142: SELECT and LOCK TABLE commands denied

查看:243
本文介绍了错误1142:SELECT和LOCK TABLE命令被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新安装了运行MySQL的服务器.我已经使用MySQL Workbench创建了数据库备份.现在,我试图通过同一程序将转储导入数据库,但是出现以下错误:

I reinstalled the server running MySQL. I had created a backup of the database by using MySQL Workbench. Now I'm trying to import the dump in to the database trough the same program but I get the following error:

ERROR 1142 (42000) at line 656: SELECT,LOCK TABL command denied to user 'root'@'MIKKOS' for table 'events_waits_summary_by_thread_by_event_name'

我坚信root拥有全部特权.我执行了以下操作,但是执行此操作后,上一个查询出现了相同的错误:

I tought that root had full privileges. I ran the following but the same error appears with the previous query after executing this:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION

它在本地运行(root @ localhost)时也会出现.

It also appears when running locally (root@localhost).

该怎么办?

推荐答案

检查转储文件中包含哪些MySQL Workbench数据库.我相信它默认转储所有内容,包括userperformance_schema之类的数据库.这些就是问题,您的授权表可能还不错.

Check which databases MySQL Workbench included in the dumpfile. I believe it defaults to dumping everything, including DBs like user and performance_schema. Those are the problem, your grant tables are probably fine.

删除不需要的数据库,尤其是performance_schema,MySQL可能会导入转储文件而不会出错.

Remove the unneeded databases, especially performance_schema and MySQL will likely import the dumpfile without errors.

这篇关于错误1142:SELECT和LOCK TABLE命令被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆