8. If the equation $x^{2}+a x+b-3=0(a, b \in \mathbf{R})$ has real roots in the interval $[1,2]$, then the minimum value of $a^{2}+(b-4)^{2}$ is $\qquad$ .
$\Rightarrow(a+b-2)(2 a+b+1) \leqslant 0$
or $\left\{\begin{array}{l}a^{2}-4 b+12 \geqslant 0, \\ a \in[-4,-2], \\ a+b-2 \geqslant 0, \\ 2 a+b+1 \geqslant 0,\end{array} \quad\right.$ the shaded region is as shown in the figure.
$a^{2}+(b-4)^{2}$ represents the square of the distance from the point $(a, b)$ to the point $(0,4)$
Since $d=\frac{4-2}{\sqrt{2}}=\sqrt{2}$,
the minimum value of $a^{2}+(b-4)^{2}$ is 2,
with equality holding when $(a, b)=(-1,3)$.