From 5db2a6755391530672d592797ce711438754d179 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 29 Jun 2016 13:52:07 -0400 Subject: [PATCH] Add mysql user to localhost account --- xCAT-client/bin/mysqlsetup | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 23e0c371d..408580e11 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -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"); }