Closed korkey128k closed 4 years ago
Hello,
how do you manually backup you database?
Said that I don't know much about operations on views, this seems a configuration problem to me more than a bug. Or, depending on the answer to the previous question, an unsupported task.
Wordmove is throwing Wordmove::ShellCommandError
just because mysqldump
errored.
If you can share your manual backup command, I'll try to figure out something more. TIA
The backup command is what wordmove is running: mysqldump --host=[secret] --user=[secret] --password=[secret] --result-file="[secret]/wp-content/dump.sql" [secret]
. We manually backup the database the same, no fancy dump flags.
If I remove the view locally (DROP VIEW *****;
) before every pull
, I can use wordmove pull -d -e staging
and everything works, but if I don't, it throws the above error.
I understand if this isn't supported, database views are pretty "close to the metal" imo. Found this stack overflow article on how to remove the definer during a dump, we could just implement that client side for a fix.
There is not an explicit support actually. This is the first time I come across such a question. And moreover I thought it was all up to mysqldump to manage the thing.
Reading the page you linked and following some link there, I also read this one; if it could work around your problem you'd just need to add the flag to the mysqldump_options
in movefile.yml
. I've already used the --single-transaction
to solve different problems and it never led to collateral effects, FWIW
Doing a --single-transaction
in the mysqldump_options
worked great. Thanks @pioneerskies!
Describe the bug When pulling a database with a view, the local backup fails to run because the definer (remote user) does not exist;
mysqldump: Got error: 1449: "The user specified as a definer ('{remote_user}'@'{remote_host}') does not exist" when using LOCK TABLES
Wordmove command
wordmove pull -d -e staging
Expected behavior The local database successfully backs up.
movefile.yml
Exception/trace
Environment (please complete the following information):
Doctor
wordmove doctor
is all green