Autotoxicity of root exudates is one of the main reasons for consecutive monoculture problem (CMP) in cucumber under greenhouse cultivation. Rootstock grafting may improve the tolerance of cucumber plants to autotoxic stress. To verify the enhanced tolerance to autotoxic stress and illuminate relevant molecular mechanism, a transcriptomic comparative analysis was performed between rootstock grafted (RG) and non-grafted (NG) cucumber plants by a simulation of exogenous cinnamic acid (CA). The present study confirmed that relatively stable plant growth, biomass accumulation, chlorophyll content, and photosynthesis was observed in RG than NG under CA stress. We identified 3647 and 2691 differentially expressed genes (DEGs) in NG and RG cucumber plants when compared to respective control, and gene expression patterns of RNA-seq was confirmed by qRT-PCR. Functional annotations revealed that DEGs response to CA stress were enriched in pathways of plant hormone signal transduction, MAPK signaling pathway, phenylalanine metabolism, and plant-pathogen interaction. Interestingly, the significantly enriched pathway of photosynthesis-related, carbon and nitrogen metabolism only identified in NG, and most of DEGs were down-regulated. However, most of photosynthesis, Calvin cycle, glycolysis, TCA cycle, and nitrogen metabolism-related DEGs exhibited not or slightly down-regulated in RG. In addition, several stress-related transcription factor families of AP2/ERF, bHLH, bZIP, MYB. and NAC were uniquely triggered in the grafted cucumbers. Overall, the results of this study suggest that rootstock grafting improve the tolerance of cucumber plants to autotoxic stress by mediating down-regulation of photosynthesis, carbon, and nitrogen metabolism-related DEGs and activating the function of stress-related transcription factor. The transcriptome dataset provides an extensive sequence resource for further studies of autotoxic mechanism at molecular level.