diff --git a/src/DB_Command.php b/src/DB_Command.php index b58ef9491..1965ba658 100644 --- a/src/DB_Command.php +++ b/src/DB_Command.php @@ -474,7 +474,14 @@ public function export( $args, $assoc_args ) { $assoc_args['result-file'] = $result_file; } - $command = '/usr/bin/env mysqldump --no-defaults %s'; + $support_column_statistics = exec( 'mysqldump --help | grep "column-statistics"' ); + + if ( $support_column_statistics ) { + $command = '/usr/bin/env mysqldump --no-defaults --skip-column-statistics %s'; + } else { + $command = '/usr/bin/env mysqldump --no-defaults %s'; + } + $command_esc_args = array( DB_NAME ); if ( isset( $assoc_args['tables'] ) ) {