]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/grant_mysql_privileges.in
bvfs: Restore should be ok with MySQL
[bacula/bacula] / bacula / src / cats / grant_mysql_privileges.in
index 0c0c6a597b721beff32a04e858dbb1761471a8df..6ff59691933272caa813c85532542f11a6dda948 100644 (file)
@@ -2,17 +2,19 @@
 #
 # shell script to grant privileges to the bacula database
 #
+db_user=${db_user:-@db_user@}
 bindir=@SQL_BINDIR@
+db_name=${db_name:-@db_name@}
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on bacula.* to bacula@localhost with grant option;
-grant all privileges on bacula.* to bacula@"%" with grant option;
+grant all privileges on ${db_name}.* to ${db_user}@localhost;
+grant all privileges on ${db_name}.* to ${db_user}@"%";
 select * from user;
 flush privileges;
 END-OF-DATA
 then
-   echo "Privileges for bacula granted."
+   echo "Privileges for user ${db_user} granted on database ${db_name}."
    exit 0
 else
    echo "Error creating privileges."