Here is another solution. Let $X_1, X_2, \cdots$ be i.i.d. and $\mathsf{P}(X_i = 0) = \mathsf{P}(X_i = 2) = \frac{1}{2}$. Then
$$ Y = \sum_{m=1}^{\infty} \frac{X_m}{3^m} \tag{*}$$
has the distribution $\mu$. So it follows that
$$ \int x^2 \, d\mu
= \mathsf{E}[Y^2]
= \mathsf{Var}(Y) + \mathsf{E}[Y]^2
= \sum_{n=1}^{\infty} \frac{1}{9^n} + \left( \sum_{n=1}^{\infty} \frac{1}{3^n} \right)^2
= \frac{3}{8}.
$$
Proof of $\text{(*)}$. Let $U$ be independent of $(X_i)_{i=1}^{\infty}$ and has the uniform distribution over $[0, 1]$. If
$$ C_n = [0, 1] \setminus \bigcup_{m=1}^{n} \bigcup_{k=0}^{3^{m-1} - 1} \left( \frac{3k+1}{3^m}, \frac{3k+2}{3^m} \right) $$
denotes the $n$-th step in the construction of the Cantor set $C$, then
$$ Y_n = \sum_{m=1}^{n} \frac{X_m}{3^m} + \frac{1}{3^n} U $$
has the uniform distribution over $C_n$. Indeed, the summation part picks one subinterval out of total $2^n$ subintervals of $C_n$ equally likely, then the uniform part $3^{-n}U$ picks a point uniformly randomly out of that subinterval. Then
Combining two facts gives the desired identity $\text{(*)}$.