Mercury ion (Hg(II)) is one of the most toxic heavy metals in the environment and has seriously damaged human health. Based on this, we designed a novel fluorescence-enhanced carbon dots/mesoporous silica fluorescent composite (CDs/MSNs) fluorescent composite sensor for rapid and sensitive detection of Hg(II) in environmental and biological systems. Carbon dots (CDs) are one of the most promising carbon-based nanomaterials of the new generation, and we chose them as template molecules, and CDs were embedded in mesoporous silica nanospheres (MSNs) by hydrothermal method to form CDs/MSNs fluorescent composite with aggregation-induced emission enhancement (AIEE). Notably, the CDs/MSNs fluorescent composite has a yellow luminescence with a photoluminescence intensity several times higher than the original one, and have high stability, excellent selectivity, and good biocompatibility, which can realize the selective and sensitive detection of Hg(II) in the environment, with a limit of detection as low as 0.89 μM. The material can also be used as an effective luminescent biological probe for the detection of Hg(II) in cells. and these properties provide long-term practical applications of CDs/MSNs fluorescent composite in the fields of biological detection.