diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 824267c8cc0ccd0639825fc7662d398f6940f25e..31927f5e8d55d49404464018b63ccab6b781cc6b 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -300,6 +300,16 @@ my @mysqlbinlog_rules=
 );
 
 
+#
+# Rules to run for [mysql_upgrade] section
+#  - will be run in order listed here
+#
+my @mysql_upgrade_rules=
+(
+ { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } },
+);
+
+
 #
 # Generate a [client.<suffix>] group to be
 # used for connecting to [mysqld.<suffix>]
@@ -606,6 +616,11 @@ sub new_config {
 			     $config->insert('mysqlbinlog'),
 			     @mysqlbinlog_rules);
 
+  # [mysql_upgrade] need additional settings
+  $self->run_rules_for_group($config,
+			     $config->insert('mysql_upgrade'),
+			     @mysql_upgrade_rules);
+
   # Additional rules required for [client]
   $self->run_rules_for_group($config,
 			     $config->insert('client'),