The magnesium and cadmium oxides (MgO, CdO) are widely used in the optoelectronic technology, for that raison it very interest subject of researches. In this work, the structural, elastic, electronic and optical properties of rock-salt Cd x Mg 1-x O were investigated using both exchange correlations LDA and GGA-WC. The calculations were implemented using Full-Potential Linearized Augmented Plane Wave (FP-LAPW) method in the framework of the Density Functional Theory (DFT). For the electronic and optical properties, the calculations were performed using the Tran-Blaha-modified Beck Johnson potential (TB-mBJ). The lattice parameter have been reported for different cadmium concentrations x in the rocksalt structure, the calculated lattice parameter to be transmitted quasi-linearly from 4.257 A to 4.43 A for rock-salts MgO and rock-salts CdO respectively, For rs MgO and rs CdO, the obtained results are very acceptable with experimental results existing in the literature. The deviations between our results and experimental data is less than 1%. The estimated bandgap values to be 7.39eV for rs-MgO (rock salt) and 1.81eV for rs-CdO, the results deviate by less than 5% from experimental results. The energy bandgap (Eg) for x = 0, 0.25, 0.50, 0.75, and x = 1 varied quasi-linearly. Moreover, the optical parameters of Cd x Mg 1-x O such as the dielectric function, the reflectivity, the refractive index, and the electron-loss-energy function have also been studied and discussed. Our findings results for rs MgO and rs CdO are also in good agreement with the experimental data, our results prove that the plasma frequency varied non-laniary from 7.33eV for rs MgO to 3.03eV for rs CdO.