  Motivated by the $R_K$ and $R_{K^*}$ anomalies from B decays, we extend the
minimal supersymmetric model with a non-universal anomaly-free $U(1)^\prime$
gauge symmetry, coupling non-universally to the lepton sector as well as the
quark sector. In particular, only the third generation quarks are charged under
this $U(1)^\prime$, which can easily evade the dilepton bound from the LHC
searches. An extra singlet is introduced to break this $U(1)^\prime$ symmetry
allowing for the $\mu$-term to be generated dynamically. The relevant
constraints of $B_s-\bar{B}_s$ mixing, $D^0-\bar{D}^0$ mixing and the LHC
dilepton searches are considered. We find that in the allowed parameter space
this $U(1)^\prime$ gauge interaction can accommodate the $R_K$ and $R_{K^*}$
anomalies and weaken considerably the $Z^\prime$ mass limits while remaining
perturbative up to the Planck scale.
