Set up database environment