5. (22nd Iranian Mathematical Olympiad) Find all prime numbers $p, q, r$ such that the equation $p^{3}=p^{2}+q^{2}+$ $r^{2}$ holds.
5. If $p=2$, substituting into the equation gives
$$
q^{2}+r^{2}=4 \text {. }
$$

This equation has no prime solutions, so $p$ is an odd prime.
Consider $q^{2}+r^{2} \equiv 0(\bmod p)$, we have
$p|q, p| r$ or $p=4 k+1$.
In the first case, since $q, r$ are primes, we can get $p=q=r$, at this time, the equation can be simplified to $p^{3}=3 p^{2}$.
Solving gives $p=q=r=3$.
In the second case,
$$
q^{2}+r^{2} \equiv 0(\bmod 4) \text {. }
$$

Thus, $2 \mid q, r$, since $q, r$ are primes, so $q=r=2$.
But $p^{3}-p^{2}=8$ has no prime solutions, finally we get the solution $p=q=r=3$.