I used to suffer badly with mouth ulcers and found anbersol the best to relieve the pain. I rarely get them now as I avoid any toothpaste with sodium lauryl sulfate in which is the cheap foaming agent in 99% of toothpaste which was suggested on a mouth ulcer thread I stumbled across years ago.
Some sensodyne and other brands don’t contain the nasty stuff