$6 \cdot 5$ If $\log _{2}\left(\log _{8} x\right)=\log _{8}\left(\log _{2} x\right)$, find $\left(\log _{2} x\right)^{2}$.
[Solution] By the change of base formula,
$$
\begin{array}{l}
\log _{2}\left(\log _{8} x\right)=\log _{2}\left(\frac{\log _{2} x}{3}\right), \\
\log _{8}\left(\log _{2} x\right)=\frac{\log _{2}\left(\log _{2} x\right)}{3} .
\end{array}
$$

Let $y=\log _{2} x$, then
$$
\begin{array}{l}
\log _{2} \frac{y}{3}=\frac{1}{3} \log _{2} y, \\
\log _{2}\left(\frac{y}{3}\right)^{3}=\log _{2} y,
\end{array}
$$

which means $\left(\frac{y}{3}\right)^{3}=y$.
Noting that $y \neq 0$, we get
$$
y^{2}=27 \text {, }
$$

i.e., $\left(\log _{2} x\right)^{2}=27$.