diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5bbd45758b5..34a4cac55bf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3790,10 +3790,11 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--connect-timeout=60", $prefix); # When mysqld is run by a root user(euid is 0), it will fail - # to start unless we specify what user to run as. If not running - # as root it will be ignored, see BUG#30630 - if (!(grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt))) { - mtr_add_arg($args, "%s--user=root"); + # to start unless we specify what user to run as, see BUG#30630 + my $euid= $>; + if (!$glob_win32 and $euid == 0 and + (grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt)) == 0) { + mtr_add_arg($args, "%s--user=root", $prefix); } if ( $opt_valgrind_mysqld )