In this work, phase stabilities, phase transitions, electronic structures and elastic properties of wurtzite structure (WZ), zinc-blende structure (ZB) and rocksalt struture (RS) phase of CdS are studied by first principles method. Results indicate that WZ and RS phases could be stable in corresponding pressure areas. However, ZB phase could not be stable. Pressure-induced metallic phase transition from WZ to RS will occur at 2.18 GPa. Electronegativity of S atom in WZ phase is much more than that of Cd atom, and the difference in electronegativity between S and Cd is less than 1.7, which induces covalent crystal of CdS. Under the condition of high pressure, radius of S is reduced sharply, which causes the increase of effective nuclear charge. Large nuclear charge will enhance the ability to attract electrons of outer shell, which will cause larger electronegativity. When pressure is higher than 2.18 GPa, the difference in electronegativity is more than 1.7. Then, CdS will be ionic crystal. C-44 of WZ phase decreases with pressure, resulting in mechanical instability. And then, the WZ-to-RS phase transition occurs at 2.18 GPa. Moreover, C-11 and C-12 of RS phase increase with pressure. At the same time, C-44 of RS is stable with pressure increasing entirely, all of which shows that RS phase has excellent stability and mechanical property under high pressure.