Skip to content

Commit 58dcfc0

Browse files
author
gitlab
committed
Merge branch '10490@@2' into 'master'
grant privileges when deploy ui db See merge request zstackio/zstack!2394
2 parents aee4271 + b56fd8c commit 58dcfc0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

conf/deployuidb.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ flyway="$base/tools/flyway-3.2.1/flyway"
1212
flyway_sql="$base/tools/flyway-3.2.1/sql/"
1313

1414
mysql --user=$user --password=$password --host=$host --port=$port << EOF
15+
grant usage on *.* to 'root'@'localhost';
16+
grant usage on *.* to 'root'@'%';
1517
DROP DATABASE IF EXISTS zstack_ui;
1618
CREATE DATABASE zstack_ui;
1719
grant all privileges on zstack_ui.* to root@'%' identified by "$password";
1820
grant all privileges on zstack_ui.* to root@'localhost' identified by "$password";
21+
flush privileges;
1922
EOF
2023

2124
rm -rf $flyway_sql
@@ -32,11 +35,10 @@ fi
3235

3336
hostname=`hostname`
3437
mysql --user=$user --password=$password --host=$host --port=$port << EOF
35-
grant usage on *.* to 'zstack_ui';
36-
drop user zstack_ui;
37-
create user 'zstack_ui' identified by "$zstack_ui_db_password";
3838
grant usage on *.* to 'zstack_ui'@'localhost';
3939
grant usage on *.* to 'zstack_ui'@'%';
40+
drop user zstack_ui;
41+
create user 'zstack_ui' identified by "$zstack_ui_db_password";
4042
grant all privileges on zstack_ui.* to zstack_ui@'localhost' identified by "$zstack_ui_db_password";
4143
grant all privileges on zstack_ui.* to zstack_ui@'%' identified by "$zstack_ui_db_password";
4244
grant all privileges on zstack_ui.* to zstack_ui@"$hostname" identified by "$zstack_ui_db_password";

0 commit comments

Comments
 (0)