0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rds mysqldumpでハマった

Last updated at Posted at 2021-11-10

備忘録です。

ほんの出来心で

rds mysqlでdumpで抜いて、リストアしようとしただけなんです、、、

ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation

くっそぅ、、、

いろいろ調べて、rdsにはそれなりのdumpの取り方があるそうで、、、

環境差はあるものの、、、

mysqldump --single-transaction --skip-triggers --set-gtid-purged=OFF -h xxxxxxxxx -u xxxxx -p db_name | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > xxxxxxxxx.dump.sql

これで、下記で素直にリストア完了

mysql -h xxxxx -u xxxx -p db_name < xxxxxx.dump.sql

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?