First off, what is a music producer? It's the job of a music producer to bring together all the resources needed to create a complete album of music. This means working with the record label, artists, sound engineers and the recording studio. In movies it's the equivalent of a director and in construction they are like a general contractor. They bring everyone together and oversee the overall vision of a musical project.
The best way to learn the ropes is to find someone that's already a successful music producer and learn from them. There's no set way to go about this so you have to be creative and think outside the box. Not all music producers are going to want an apprentice. Do some research and seek out producers. Ask questions and simply try to win one over.
You're going to need to make some connections in the music business, and the best way to do that is getting a job. You're going to have to start at the bottom and work your way up. Seek out recording studios and record labels and try to find out where they need help. Anything that gets you in the door can lead to something more. Your main goal should be building up as many positive relationships as possible.
You can go to school for music production. The two most well-known schools for getting into the music business are Berklee College of Music in Boston and Full Sail in Florida. They do cost a good amount of money and you're still going to need to do one of the two options above though. A good school should help you with connections and getting a job, but just understand there's no guarantees.