]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/grant_mysql_privileges.in
Fix #1684 Use --with-db-password option in grant_bacula_privileges scripts
[bacula/bacula] / bacula / src / cats / grant_mysql_privileges.in
index 6ff59691933272caa813c85532542f11a6dda948..09a1569fa12a01069f16ccc4f6dee8fdffd5975c 100644 (file)
@@ -5,11 +5,15 @@
 db_user=${db_user:-@db_user@}
 bindir=@SQL_BINDIR@
 db_name=${db_name:-@db_name@}
+db_password=@db_password@
+if [ "$db_password" != "" ]; then
+   pass="identified by '$db_password'"
+fi
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on ${db_name}.* to ${db_user}@localhost;
-grant all privileges on ${db_name}.* to ${db_user}@"%";
+grant all privileges on ${db_name}.* to ${db_user}@localhost ${pass};
+grant all privileges on ${db_name}.* to ${db_user}@"%" ${pass};
 select * from user;
 flush privileges;
 END-OF-DATA