"I have a stomach ache."
Translation:У мене болить живіт.
It is incorrect, indeed.
"У мене болить живіт" - this sentence is structurally more like "My stomach aches", or, literally, "[To me] aches the stomach".
So the gist of it is "The stomach aches, and it is happening to me".
I know the literal translation probably makes no sense, but I had to do it to show it doesn't have the "У мене є" = "I have" construction.
This is true for all aches.
I have a toothache - У мене болить зуб
I have a headache - У мене болить голова.
The thing that hurts is the subject of the sentence and used in Nominative (although it's in the end of the sentence, but that's fine for Ukrainian), and the main verb is "to hurt", or "to ache" - "боліти".
In informal dialogues you can actually shorten it to something like "Живіт болить" or "Болить живіт" where the structure is more obvious.
- Що з тобою?
- Живіт болить...
"What's going on with you?" - "I have a stomachache" (lit. "The stomach aches/hurts".
It would probably be helpful to include a few examples where it's not me who has a stomachache (or other ache).
My father has a toothache - У тата болить зуб.
Does your knee hurt? - У тебе болить коліно?
His ear aches a lot - У нього сильно болить вухо.
We all have a stomachache - У нас у всіх болять животи (The stomachs hurt [and it's happening to all of us])