2. The number of real numbers $a$ that make the equation
$$
x^{2}+a x+8 a=0
$$

have only integer solutions is $\qquad$ .
2. 8 .

Let the equation (1) have integer solutions $m, n (m \leqslant n)$. Then $m+n=-a, mn=8a$.
Thus, $(m+8)(n+8)=64$.
Solving for $(m, n)$
$$
\begin{array}{c}
=(-72,-9),(-40,-10),(-24,-12), \\
(-16,-16),(-7,56),(-6,24), \\
(-4,8),(0,0) .
\end{array}
$$

Correspondingly,
$$
\begin{array}{l}
a=-(m+n) \\
=81,50,36,32,-49,-18,-4,0,
\end{array}
$$

a total of 8.