2. In the Cartesian coordinate system $x O y$, a circle passes through $(0,2)$ and $(3,1)$, and is tangent to the $x$-axis. Then the radius of this circle is $\qquad$ .
2. $15 \pm 6 \sqrt{5}$.

Let the equation of the circle be $(x-a)^{2}+(y-r)^{2}=r^{2} (r>0$ being the radius), then we have
$$
\left\{\begin{array}{l}
(0-a)^{2}+(2-r)^{2}=r^{2}, \\
(3-a)^{2}+(1-r)^{2}=r^{2},
\end{array}\right.
$$

which simplifies to
$$
\left\{\begin{array}{l}a^{2}=4 r-4, \\ a^{2}-6 a=2 r-10 .\end{array}\right.
$$
Subtracting the two equations yields $a=1+\frac{r}{3}$. Therefore,
$$
\left(1+\frac{r}{3}\right)^{2}=4 r-4 \text {. }
$$

Solving this, we get $r=15 \pm 6 \sqrt{5}$.