Mg-doped ZnO nanorods with different contents have been fabricated on various substrates by hydrothermal method. The effects of Mg-contents and different substrates on structural and optical properties are analyzed by scanning electron microscopy, X-ray diffraction, photoluminescence (PL) spectra, energy dispersive X-ray spectroscopy and Raman spectroscopy. The results reveal that the Mg-doped ZnO nanorods possess good crystalline quality and morphology when the molar ratio of Mg/Zn is 1. The PL spectra show that the UV emissions have an obvious blue shift with the increase of Mg-content. The results of investigation for the samples grown on different substrates show that the crystal quality and morphology of the samples grown on ZnO layer are perfect, and the UV emission also occurs blue shift owing to the effects of different substrates.