Mitochondrial dysfunction is considered an early event of Alzheimer disease (AD). D-ribose is a natural monosaccharide that exists in cells, especially in mitochondria, and can lead to cognitive dysfunction. However, the reason for this is unclear. Berberine (BBR) is an isoquinoline alkaloid that can target mitochondria and has great prospect in the treatment of AD. The methylation of PINK1 reinforces the burden of Alzheimer’s pathology. This study explores the role of BBR and D-ribose in the mitophagy and cognitive function of AD related to DNA methylation. APP/PS1 mice and N2a cells were treated with D-ribose, BBR, and mitophagy inhibitor Mdivi-1 to observe their effects on mitochondrial morphology, mitophagy, neuron histology, AD pathology, animal behavior, and PINK1 methylation. The results showed that D-ribose induced mitochondrial dysfunction, mitophagy damage, and cognitive impairment. However, BBR inhibition of PINK1 promoter methylation can reverse the above effects caused by D-ribose, improve mitochondrial function, and restore mitophagy through the PINK1–Parkin pathway, thus reducing cognitive deficits and the burden of AD pathology. This experiment puts a new light on the mechanism of action of D-ribose in cognitive impairment and reveals new insights in the use of BBR for AD treatment.