Let $X$ be an infinite set and fix $a\
eq b$ in $X$. Let $\tau$ be the topology generated by the singletons $\\{x\\}$ for $x\
eq a$ and the set $\\{a,b\\}$. So every set $U\subset X$ is open, provided that $a\in U\to b\in U$. This is not compact and not $T_2$, since we cannot separate $a$ from $b$. But the only larger topology is the discrete topology, which is $T_2$.