How do you get mildew and its musty smell out of carpeting?
Your best bet it to sprinkle the area with baking soda, let it sit for 15 minutes, and then vacuum it up. Or you could leave the baking soda on overnight. Removing the smell may take repeated applications, but eventually the baking soda should absorb all the odor. Test the carpet for colorfastness before treating a large area.