There are several causes for the mid right back pain following are due to muscle strain,slipping of the inter-vertebral disc,pregnancy and due to some diseases like gastroenteritis
You could have a UTI/kidney infection/cystitis. Sometimes it causes back pain. See your doctor if it doesn't ease up, even if you don't notice more urination.
Gastric problem or doing monotonous work using same hand or posture may cause the pain. But if it is prolonging may be some spinal cord problem. Consult a doctor immediately.