Can't upload to Arduino Mega 2560

Well, the com port appears. If I do not connect the arduino, the compiler returns 'avrdude: ser_open(): can't open device "\.\COM3"'.
So my arduino connects to my pc. It start compiling and uploaden so the com port is in use. If I want to try uploading again, I first have to disconnect my arduino from the usb port, otherwise it says 'com port in use'.