2. Solve the equation in the set of prime numbers

$$
x^{y}-y^{x}=x \cdot y^{2}-19 \text {. }
$$
2. By Fermat's theorem, $x^{y} \equiv x \pmod{y}$, so from the given equation we get $x \equiv -19 \pmod{y}$, i.e., $y \mid x+19$. Similarly, reduction modulo $x$ gives $x \mid y-19$. Since there is no solution for $x=y$, it follows that $xy \mid x-y+19$. However, $x-y+19=0$ is impossible: indeed, $x$ would have to be even, i.e., $x=2$, but then $y=21$ is not prime. Therefore, $xy \leq |x-y+19| < x+y+19$, i.e., $(x-1)(y-1) < 20$.

It remains to examine a few cases: (1) $x=2, y \leq 19$; (2) $x=3, y \leq 7$; (3) $y=3, 5 \leq x \leq 7$; or (4) $y=2, 5 \leq x \leq 19$. By direct verification, we find that $(2,3)$ and $(2,7)$ are the only solutions $(x, y)$.