If $\mathfrak{g}$ is a Lie algebra and $M$ is an *abelian* $\mathfrak{g}$-module, then Lie algebra cohomology $H^2(\mathfrak{g}, M)=Ext^2_{U(\mathfrak{g})}(k, M)$ classify (abelian) extensions of $\mathfrak{g}$ by $M$, that is, exact sequences
$$0 \to M \to \mathfrak{g}' \xrightarrow{\pi} \mathfrak{g} \to 0$$
of Lie algebras. (To be more precise, $M$ is automatically $\mathfrak{g}$-module by $gm:=[g', m]$ for $\pi(g')=g,$ abelianness of $M$ implies correctness, and we also ask that this $\mathfrak{g}$-module structure coincides with a given one.)

Moreover, $H^1(\mathfrak{g}, M)=Hom_{Lie}(\mathfrak{g}, M)$ for an *abelian* $\mathfrak{g}$-module $M$. Unfortunately, the category of Lie algebras is not abelian (as the image is not an ideal).

So is it possible to say that $H^i(\mathfrak{g}, M)=Ext^i_{U(\mathfrak{g})}(k, M)=Ext^{i-1}_?(\mathfrak{g}, M)$ for some abelian category ?

If not, what phenomenon does it reflect? By the way, the same happens for group cohomology. Maybe, the question is better there?