create database config file only if connected to db