diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index e61857a20..e242ed930 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -916,7 +916,13 @@ sub initmysqldb } else { - $cmd = "/usr/bin/mysql_install_db --user=mysql"; + my $sqlcmd = "/usr/bin/mysql_install_db"; + if (!(-x ($sqlcmd))) { + xCAT::MsgUtils->message("E", "$sqlcmd is not available, please install required mysql/mariadb packages"); + exit(1); + } + + $cmd = "$sqlcmd --user=mysql"; } xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0)