β-amyloid (Aβ) is an important protein molecule in the pathology of Alzheimer’s disease (AD). Accumulation of Aβ leads to the loss of dendritic spines and synapses. These impairments can be ameliorated by histone deacetylase inhibitors (HDACI). However, the mechanisms of HDACIs underlying the effect on synapse are not fully understood. In this study, we examined the relationship between HDAC activity and synapse-related genes and proteins by the administration of a class I HDAC inhibitor, BG45, in the exogenous Aβ-treated cells and mice. Our studies showed that the treatment of HF-488-Aβ1–42 to SH-SY5Y cells first increased the expression of the postsynaptic dendritic protein (PSD), then decreased it after 36 h. BG45 can alleviate the reduction of the expression of PSD-95 as well as spinophilin and cytoskeletal protein induced by HF-488-Aβ1–42 aggregation in SH-SY5Y cells. Similar to the results in vitro, PSD-95 in the hippocampus was temporarily increased in the early days of intravenous injection HF-488-Aβ1–40 to the mice, followed by the decreased expression of PSD-95 on the 9th day. In further studies, for the mice treated with Aβ for 9 days, we found that BG45 decreased the expression of HDAC1 and 2, increased the expression of PSD-95, spinophilin, and synaptophysin (SYP). Our data also showed that BG45 upregulated levels of three synapse-related genes and proteins GRIK2, SCN3B, and SYNPR. These findings suggest that the exogenous Aβ may stimulate transiently the expression of PSD-95 at an early stage, but subsequently contribute to synaptic defects. HDAC1 and 2 are involved in synaptic defects, and BG45 may improve the expression of synaptic and cytoskeletal proteins and repair cytoskeletal damage by specifically inhibiting HDAC1 and 2, thereby modulating synapse-related genes. BG45 might be a potential therapeutic agent for the treatment of an early stage of Aβ-related neurodegenerative disease.