2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-21 02:30:21 +00:00

Add mysql user to localhost account

This commit is contained in:
Casandra Qiu
2016-06-29 13:52:07 -04:00
parent 777164c7de
commit 5db2a67553

View File

@@ -914,6 +914,7 @@ sub initmysqldb
exit(1);
}
}
#-----------------------------------------------------------------------------
@@ -1213,6 +1214,14 @@ sub setupxcatdb
$grantall .= "\'";
$grantall .= " IDENTIFIED BY \'$::adminpassword\';\r";
#GRAND user xcatadmin to localhost account
my $grantall_localhost= "";
$grantall_localhost = "GRANT ALL on xcatdb.* TO xcatadmin@";
$grantall_localhost .= "\'";
$grantall_localhost .= "localhost";
$grantall_localhost .= "\'";
$grantall_localhost .= " IDENTIFIED BY \'$::adminpassword\';\r";
#
# -re $pwd_prompt
# Enter the password for root
@@ -1279,6 +1288,8 @@ sub setupxcatdb
$mysql->clear_accum();
$mysql->send("$grantall");
$mysql->clear_accum();
$mysql->send("$grantall_localhost");
$mysql->clear_accum();
$mysql->send("exit;\r");
}