iPhone 4 will charge in wall, but won't sync or charge via USB I have an iPhone 4 that is showing its age.  It will charge when plugged into the wall charger.  However, when I plug the same cable into a USB port on my computer it will not charge or be recognized at all by iTunes.

When I plug my new iPhone 4S into the same cable it is recognized and syncs just fine.

Is there anything I can try to get the iPhone 4 syncing via USB so I can update the OS and sync with iTunes, etc?

Edit: I will occasionally get the "This accessory is not optimized for this iPhone" message when I plug the iPhone into the cable connected to the USB port.
I know, in most cases, this problem to be the usb port on the iphone. Unfortunately this part seems to be a part which only one in five of these parts to be good from experience. Either the mic or data port are defective which makes a diy repair frustrating. Most people will change it once they hit a defect part and give up. Don't give up. Trying to help people who are frustrated as I was. Usually occurs when you update with a port having bad contacts and ends up with a no sync or no voice on phone mic. May not be what you want to hear.