diff --git a/lib/ecto/adapters/myxql.ex b/lib/ecto/adapters/myxql.ex index 28dc43a2..bfd9e41d 100644 --- a/lib/ecto/adapters/myxql.ex +++ b/lib/ecto/adapters/myxql.ex @@ -379,7 +379,13 @@ defmodule Ecto.Adapters.MyXQL do @impl true def dump_cmd(args, opts \\ [], config) when is_list(config) and is_list(args) do - args = args ++ [config[:database]] + args = + if database = config[:database] do + args ++ [database] + else + args + end + run_with_cmd("mysqldump", config, args, opts) end