This is one of the toughest stains alive. Not only that, mildew is an fungus that in the process of growing, actually eats and weakens the cloth.
If you caught it right away, soaking overnight in a strong detergent solution and then scrubbing by hand or with a brush may remove most of it. The only thing that I know of that complete removes the stain is a chlorine bleach in a dilute solution, not good for all but whites and sturdy material. I've used this on especially comfortable cotton/polyester blends, but afterwards had to use them for gardening, housework, etc. as the color faded.
Mildew - Pre-treat as soon as possible with detergent. Wash. If any stain remains, sponge with lemon juice and salt. Dry in sun. Wash, using hottest water, detergent and bleach safe for fabric.
Mildew stains may be removed by rubbing with a paste made by mixing two tsp. of water, one of powdered chalk and two of soap powder. The spots should afterwards be well rinsed and dried out of doors in the sunlight. This has a bleaching effect on them.
Soak mildew stains for several hours in a weak solution of chloride of lime; afterwards rinse in cold water. If it was quite a few days, unfortunately, even if you were able to remove or bleach the stain, the fabric probably won't hold up long. Better to throw it out.
Has anyone successfully removed mildew from clothing without doing more damage?
Spray with white vinegar & then wash in the hottest water material will allow with detergent & vinegar rubbed in. You can also try making a homemade prewash stain treatment of equal parts vinegar, ammonia & Wisk Laundry detergent & 1/2 cup water. Mix & put in a spray bottle for treating stains before washing. I used this mixture & it worked wonderful. The measurements are 1/2 cup each.