【发布时间】: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