{
   my $db = $bandwidthd{DbName} || 'bandwidthd';
   my $user = $bandwidthd{DbUser} || 'bandwidthd';
   my $pass = $bandwidthd{DbPassword} || 'changemebandwidthd';
   $OUT .= <<END
#! /bin/sh
   if [ -d /var/lib/mysql/$db ]; then
     exit
   fi
   /usr/bin/mysql <<EOF
   CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
   use $db;
   #Insert application specific command to create database structure
   
   use mysql;
   GRANT ALL PRIVILEGES ON $db.* TO $user\@localhost
           IDENTIFIED BY '$pass';
   flush privileges;
EOF
END
}