Determine all primes $p$, for which there exist positive integers $m, n$, such that $p=m^2+n^2$ and $p|m^3+n^3+8mn$.
To determine all primes \( p \) for which there exist positive integers \( m \) and \( n \) such that \( p = m^2 + n^2 \) and \( p \mid m^3 + n^3 + 8mn \), we proceed as follows:

1. **Express the given conditions:**
   \[
   p = m^2 + n^2
   \]
   \[
   p \mid m^3 + n^3 + 8mn
   \]

2. **Use the fact that \( p \) is a prime and \( p = m^2 + n^2 \):**
   Since \( p \) is a prime and can be expressed as a sum of two squares, by Fermat's theorem on sums of two squares, \( p \) must be of the form \( p \equiv 1 \pmod{4} \) or \( p = 2 \).

3. **Simplify the divisibility condition:**
   We need to show that \( p \mid m^3 + n^3 + 8mn \). We can rewrite \( m^3 + n^3 + 8mn \) using the identity for the sum of cubes:
   \[
   m^3 + n^3 = (m+n)(m^2 - mn + n^2)
   \]
   Thus,
   \[
   m^3 + n^3 + 8mn = (m+n)(m^2 - mn + n^2) + 8mn
   \]

4. **Substitute \( p = m^2 + n^2 \):**
   Since \( p = m^2 + n^2 \), we have:
   \[
   m^2 + n^2 \mid (m+n)(m^2 - mn + n^2) + 8mn
   \]

5. **Check specific values:**
   Let's check specific values of \( m \) and \( n \) to find possible primes \( p \).

   - For \( m = 1 \) and \( n = 1 \):
     \[
     p = 1^2 + 1^2 = 2
     \]
     \[
     m^3 + n^3 + 8mn = 1^3 + 1^3 + 8 \cdot 1 \cdot 1 = 2 + 8 = 10
     \]
     Since \( 2 \nmid 10 \), \( p = 2 \) is not a solution.

   - For \( m = 2 \) and \( n = 1 \):
     \[
     p = 2^2 + 1^2 = 4 + 1 = 5
     \]
     \[
     m^3 + n^3 + 8mn = 2^3 + 1^3 + 8 \cdot 2 \cdot 1 = 8 + 1 + 16 = 25
     \]
     Since \( 5 \mid 25 \), \( p = 5 \) is a solution.

   - For \( m = 1 \) and \( n = 2 \):
     \[
     p = 1^2 + 2^2 = 1 + 4 = 5
     \]
     \[
     m^3 + n^3 + 8mn = 1^3 + 2^3 + 8 \cdot 1 \cdot 2 = 1 + 8 + 16 = 25
     \]
     Since \( 5 \mid 25 \), \( p = 5 \) is a solution.

   - For \( m = 2 \) and \( n = 2 \):
     \[
     p = 2^2 + 2^2 = 4 + 4 = 8
     \]
     Since 8 is not a prime, this case is not valid.

6. **Conclusion:**
   The only prime \( p \) that satisfies the given conditions is \( p = 5 \).

The final answer is \( \boxed{5} \)