5. Let $x$, $y$, and $z$ all be prime numbers, and $x \leqslant y \leqslant z$. Then the number of positive integer solutions to the indeterminate equation $x^{2}+y^{2}+z^{2}=2019$ is ( ) groups.
(A) 3
(B) 4
(C) 5
(D) 6
5. C.

Notice that, prime numbers $x \leqslant y \leqslant z$.
From $3 x^{2} \leqslant 2019$
$$
\Rightarrow 2 \leqslant x \leqslant 25 \text {. }
$$

Therefore, all possible values of $x$ and $y$ are:
$$
2, 3, 5, 7, 11, 13, 17, 19, 23 \text {. }
$$

From $3 z^{2} \geqslant 2019, z^{2}<2019$
$$
\Rightarrow 26 \leqslant z<45 \text {. }
$$

Therefore, all possible values of $z$ are:
$$
29, 31, 37, 41, 43 \text {. }
$$

When $z=29$,
$$
x^{2}+y^{2}=2019-29^{2}=1178 \text {, }
$$

no solution;
When $z=31$,
$$
\begin{array}{l}
x^{2}+y^{2}=2019-31^{2} \\
=1058=23^{2}+23^{2} ;
\end{array}
$$

When $z=37$,
$$
\begin{array}{l}
x^{2}+y^{2}=2019-37^{2}=650 \\
=11^{2}+23^{2}=17^{2}+19^{2} ;
\end{array}
$$

When $z=41$,
$$
\begin{array}{l}
x^{2}+y^{2}=2019-41^{2}=338 \\
=7^{2}+17^{2}=13^{2}+13^{2} ;
\end{array}
$$

When $z=43$,
$$
x^{2}+y^{2}=2019-43^{2}=170 \text {, }
$$

no solution.
In summary, the original indeterminate equation has five solutions:
$$
\begin{array}{l}
(x, y, z) \\
=(23,23,31),(11,23,37),(17,19, \\
37),(7,17,41),(13,13,41) .
\end{array}
$$