Rather than taking out the console and risking the chance to break the wood here is how I did it on a 1991 560-SEL. Remove the ash tray insert. You will see 2 screws that hold the ash tray assembly in place---remove these. Unplug the lighter and remove the light from the assembly--- remove the ash tray assembly. This will enable you to remove the coin caddy and the panel that holds the seat heater and horn switches. Unplug the switches and remove the panel. At this point you will be able to access the locknut on the shift lever from the space vacated by the ash tray and switch panel. You will have to push bach the rubber boot that covers the locknut. I would follow the advice to put the car in either neutral or drive so that the shift lever is somewhat straight in the gate.
I had to modify the 17mm wrench that I used by sawing off the end opposite the jaws to get a better angle on the lock nut. Once you unlock the nut by turning counter clockwise, unscrew the shaft and repeat in the opposite to install the new knob and shaft. Before putting it back together make sure that the gears engage properly. Due to the different angles on the shaft a slight variation from the original can cause problems as peterhardie described.