【问题标题】:Mysqldump couldn't excute show fieldsmysqldump 无法执行显示字段
【发布时间】:2015-01-02 10:42:00
【问题描述】:

我正在尝试创建一个 mysql 转储文件,但我遇到了重大问题:

首先我尝试过:

mysqldump --user=root --password=**** --host=localhost system_db > /var/www/system_db/site/resources/backup/file.sql

我收到了消息:

mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES

然后我尝试更新用户:

UPDATE `mysql`.`proc` p SET definer = 'root@localhost' WHERE definer='root@%'

然后再次运行该语句,但没有运气。

然后我尝试了:

mysqldump --single-transaction -u root -p system_*** > db.sql

这可行,但现在我收到以下错误:

mysqldump: Couldn't execute 'SHOW FIELDS FROM `v_user_stats`': SELECT command denied to user ''@'%' for column 'user_id' in table 'test_score' (1143)

谁能告诉我发生了什么事?以及如何解决?

【问题讨论】:

  • @rajasimon 我该怎么做?
  • 似乎是 mysqldump 错误,它不使用调用者(root)权限,而是使用定义者权限:bugs.mysql.com/bug.php?id=70907

标签: mysql linux mysqldump


【解决方案1】:

如果您发现 In_use 大于 0,则只需使用 SHOW OPEN TABLES;,则该表已锁定 ....

我认为解锁的命令是UNLOCK TABLES

【讨论】:

  • 对我不起作用。表已打开(in_use = 0),但仍无法执行 SHOW FIELDS。同时我可以执行 SHOW CREATE VIEW,并让所有的权限都在 .
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-02-24
  • 2018-08-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-21
相关资源
最近更新 更多