Mushrooms produce a large number of medicinal bioactive metabolites with antioxidant, anticancer, antiaging, and other biological activities. However, whether they produce flavonoids and, if so, how they synthesize them remains a matter of some debate. In the present study, we combined flavonoid-targeted metabolomics and transcriptome analysis to explore the flavonoid synthesis in the medicinal mushroom Sanghuangporus baumii. The S. baumii synthesized 81 flavonoids on a chemically defined medium. The multiple classes of flavonoids present were consistent with the biosynthetic routes in plants. However, paradoxically, most of the genes that encode enzymes involved in the flavonoid biosynthetic pathway are missing from S. baumii. Only four genes related to flavonoid synthesis were found in S. baumii, among which phenylalanine ammonia lyase gene (PAL) is a key gene regulating flavonoid synthesis, and overexpression of SbPAL increases the accumulation of flavonoids. These results suggest that the flavonoid synthesis pathway in S. baumii is different from that in known plants, and the missing genes may be replaced by genes from the same superfamilies but are only distantly related. Thus, this study provides a novel method to produce flavonoids by metabolic engineering using mushrooms.