docs: def configure_db(self, hostname, database, username, admin=False):
          """Configure access to database for username from hostname."""
          self.connect(password=self.get_mysql_root_password())
          if not self.database_exists(database):
              self.create_database(database)
  
          remote_ip = self.normalize_address(hostname)
          password = self.get_mysql_password(username)
          if not self.grant_exists(database, username, remote_ip):
              if not admin:
                  self.create_grant(database, username, remote_ip, password)
              else:
                  self.create_admin_grant(username, remote_ip, password)
              self.flush_priviledges()
  
          return password