This most likely sounds like a recurrent aphthous or traumatic ulcer, especially since it is painful and you have low
Vitamin B12 (which commonly causes mouth ulcers).
Start B12 supplementation, use a topical ulcer gel, and avoid spicy foods. Also check for any sharp tooth irritation.
If it does not heal within 2 weeks or increases in size, get it examined. For now, it appears more nutritional/traumatic than serious.