]> git.sur5r.net Git - bacula/bacula/commitdiff
Do not produce error if MySQL database exists in create_mysql_database
authorKern Sibbald <kern@sibbald.com>
Sat, 27 May 2017 06:02:07 +0000 (08:02 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 27 May 2017 06:02:07 +0000 (08:02 +0200)
bacula/src/cats/create_mysql_database.in

index 123aa0bb402e3ab67a33a9d727e7a06cf5f16e7c..63199f8099212f0a644295109b2efbabf6372c99 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2000-2015 Kern Sibbald
+# Copyright (C) 2000-2017 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # shell script to create Bacula database(s)
@@ -10,7 +10,7 @@ bindir=@MYSQL_BINDIR@
 db_name=@db_name@
 
 if $bindir/mysql $* -f <<END-OF-DATA
-CREATE DATABASE ${db_name};
+CREATE DATABASE IF NOT EXISTS ${db_name};
 END-OF-DATA
 then
    echo "Creation of ${db_name} database succeeded."