5. Given that $a$ and $b$ are real numbers, and satisfy
$$
\sqrt{a+1}+\sqrt{a^{2} b-4 a^{2}}+|6-2 b|=2 \text {. }
$$

Then the number of real number pairs $(a, b)$ that satisfy the condition is ( ).
(A) 4
(B) 3
(C) 2
(D) 1
5. B.
(1) When $a=0$, the original equation becomes
$$
1+|6-2 b|=2 \text {. }
$$

Solving, we get $b=\frac{5}{2}$ or $\frac{7}{2}$.
At this point, $(a, b)$ is $\left(0, \frac{5}{2}\right)$ or $\left(0, \frac{7}{2}\right)$.
(2) When $a \neq 0$, $a^{2}>0$.

From the problem, we know $a^{2} b-4 a^{2} \geqslant 0$.
Solving, we get $b \geqslant 4$.
From the original inequality, we know $|6-2 b| \leqslant 2$.
Solving, we get $b=4$.
Substituting $b=4$ into the original equation, we get $a=-1$.
At this point, $(a, b)$ is $(-1,4)$.
Therefore, there are 3 pairs of real numbers $(a, b)$ that satisfy the conditions.