async def _connect(self) -> None:
        """Establish database connection with timeout and error handling."""
        if not self.pool:
            try:
                # Convert localhost to 127.0.0.1 to avoid DNS resolution issues
                host = (
                    "127.0.0.1"
                    if self.config["host"].lower() in ("localhost", "127.0.0.1")
                    else self.config["host"]
                )

                self.pool = await aiomysql.create_pool(
                    host=host,
                    port=self.config["port"],
                    user=self.config["user"],
                    password=self.config["password"],
                    db=self.config["database"],
                    connect_timeout=10,
                )
            except aiomysql.Error as e:
                raise ValueError(f"Database connection failed: {str(e)}") from e
Establish database connection with timeout and error handling.
backend/airweave/platform/sources/mysql.py