The present invention provides a complex of formula (I) or a solvate thereof (wherein n is 1 to 4), a pharmaceutical composition, and use of the pharmaceutical composition in the prevention or treatment of surgical pain, intraoperative pain and postsurgical pain. The technical solution according to the present invention provides a medicament which can be produced by a simple production process and can stably release a local anesthetic in body for a long period. The medicament can be released for at least three days or more, which can prolong the analgesic effect on the postsurgical pain, can be used conveniently by the physician and the patient, and has a good treatment compliance.