我正在尝试创建一个 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)
谁能告诉我这是怎么回事?我该如何解决?
最佳答案
只需使用 SHOW OPEN TABLES;
如果您发现 In_use 大于 0,那么该表将被锁定....
我认为解锁的命令是 UNLOCK TABLES
关于Mysqldump 无法执行显示字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27740841/