File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -714,9 +714,12 @@ public function import( $args, $assoc_args ) {
714714 $ result_file = sprintf ( '%s.sql ' , DB_NAME );
715715 }
716716
717- $ mysql_args = [
718- 'database ' => DB_NAME ,
719- ];
717+ // Process options to MySQL.
718+ $ mysql_args = array_merge (
719+ [ 'database ' => DB_NAME ],
720+ self ::get_mysql_args ( $ assoc_args ),
721+ self ::get_dbuser_dbpass_args ( $ assoc_args )
722+ );
720723
721724 if ( '- ' !== $ result_file ) {
722725 if ( ! is_readable ( $ result_file ) ) {
@@ -733,8 +736,6 @@ public function import( $args, $assoc_args ) {
733736 } else {
734737 $ result_file = 'STDIN ' ;
735738 }
736- // Check if any mysql option pass.
737- $ mysql_args = array_merge ( $ mysql_args , self ::get_mysql_args ( $ assoc_args ) );
738739
739740 $ command = sprintf ( '/usr/bin/env mysql%s --no-auto-rehash ' , $ this ->get_defaults_flag_string ( $ assoc_args ) );
740741 WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
You can’t perform that action at this time.
0 commit comments