While there are many different treatments for pain, your doctor may decide that a muscle relaxer is the best solution for you ... So can using them over a long period of time.
However, they are not considered first-line therapies for these conditions and are generally not intended for long-term use. Tizanidine and cyclobenzaprine are two commonly used muscle relaxers.