connecting to and creating database