diff --git a/lib/bash/collect_mysql_info.sh b/lib/bash/collect_mysql_info.sh index ff79deb6..ba35831a 100644 --- a/lib/bash/collect_mysql_info.sh +++ b/lib/bash/collect_mysql_info.sh @@ -234,7 +234,7 @@ collect_mysql_info () { local port="$(get_var port "$dir/mysql-variables")" local cnf_file="$(find_my_cnf_file "$dir/mysqld-instances" ${port})" - cat "$cnf_file" > "$dir/mysql-config-file" + [ -e "$cnf_file" ] && cat "$cnf_file" > "$dir/mysql-config-file" local pid_file="$(get_var "pid_file" "$dir/mysql-variables")" local pid_file_exists="" diff --git a/t/lib/bash/collect_mysql_info.sh b/t/lib/bash/collect_mysql_info.sh index d021460c..390d051c 100644 --- a/t/lib/bash/collect_mysql_info.sh +++ b/t/lib/bash/collect_mysql_info.sh @@ -28,7 +28,7 @@ wait file_count=$(ls "$p" | wc -l) -is $file_count 14 "Creates the correct number of files (without --databases)" +is $file_count 13 "Creates the correct number of files (without --databases)" awk '{print $1}' "$p/mysqld-instances" > "$PT_TMPDIR/collect_mysqld_instances1.test" pids="$(_pidof mysqld)"