Chew a fresh clove of garlic. It's antiseptic and the terrible burning pain from the allicin activating your pain receptors will drown out whatever pain you're feeling from the mouth ulcer. You also won't be able to taste anything for a while, so you'll be less inclined to try eating.