The low analgesic efficiency has limited magnesium used in analgesia. Here, we report boron hydride (BH) with ion current rectification activity can significantly improve the analgesic efficiency of magnesium, even higher than morphine. The synthesized injectable MgB2 composes of hexagonal boron sheets alternating with Mg2+. In pathological environment, while the intercalated Mg2+ will be exchanged by H+, the 2‐dimensional borophene‐analogue BH sheets will be formed to interact with the charged cations via the cation‐pi interaction, synergistically leading to a sort of two‐way dynamic modulation of sodium and potassium ion currents in neurons. By coordinating with the released Mg2+ to compete Ca2+, the threshold potential remarkably increases from the normal ‐35.9 mV to ‐5.9 mV, which significantly suppresses neuronal excitability, providing a potent analgesic effect. In three typical pain models , including CFA‐induced inflammatory pain, PINP‐ or CCI‐induced neuropathic pain, MgB2 demonstrates its analgesic efficiency approximately 2.23, 3.20, and 2.0 times higher than the clinical MgSO4, respectively. The development of MgB2 as analgesic drugs addresses the unmet medical need of pain relief without the risks of drug tolerance or addiction to opioids.