You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2014/12/11 20:15:04 UTC

ambari git commit: AMBARI-8670. Reconfigure default Mysql for Hive metastore, to support hive metastore ha.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/trunk c15cd0e09 -> 4d7c2e4f2


AMBARI-8670. Reconfigure default Mysql for Hive metastore, to support hive metastore ha.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4d7c2e4f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4d7c2e4f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4d7c2e4f

Branch: refs/heads/trunk
Commit: 4d7c2e4f203d23bd1eaee5b22e5a73de054d0ee2
Parents: c15cd0e
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Thu Dec 11 21:13:08 2014 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Thu Dec 11 21:13:08 2014 +0200

----------------------------------------------------------------------
 .../HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4d7c2e4f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
index dd6b131..f312f9a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
@@ -26,9 +26,10 @@ mysqldbpasswd=$3
 userhost=$4
 
 sudo service $mysqldservice start
-echo "Adding user $mysqldbuser@$userhost and $mysqldbuser@localhost"
-sudo su mysql -s /bin/bash - -c "mysql -u root -e \"CREATE USER '$mysqldbuser'@'$userhost' IDENTIFIED BY '$mysqldbpasswd';\""
-sudo su mysql -s /bin/bash - -c "mysql -u root -e \"GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'$userhost';\""
+echo "Adding user $mysqldbuser@% and removing users with empty name"
+sudo su mysql -s /bin/bash - -c "mysql -u root -e \"CREATE USER '$mysqldbuser'@'%' IDENTIFIED BY '$mysqldbpasswd';\""
+sudo su mysql -s /bin/bash - -c "mysql -u root -e \"GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'%';\""
+sudo su mysql -s /bin/bash - -c "mysql -u root -e \"DELETE FROM mysql.user WHERE user='';\""
 sudo su mysql -s /bin/bash - -c "mysql -u root -e \"flush privileges;\""
 
 sudo service $mysqldservice stop