To gain further insights into the formation of cocrystals, the thermodynamic mechanism and molecular recognition process of cocrystal formation were investigated by using p-hydroxybenzoic (PHBA) as the model compound. One new 1 : 1 (molar ratio) cocrystal of p-hydroxybenzoic (PHBA) and glutaric acid (GA) was successfully synthesized via several methods, including liquid-assisted grinding, cooling crystallization, and slurry conversion crystallization. The prepared cocrystal powder was characterized by PXRD, DSC and Raman spectroscopy. The crystal structure of the cocrystal was determined and interpreted by single-crystal XRD. The ternary phase diagrams of the newly prepared cocrystal were constructed in acetonitrile at three temperatures, i.e., 2, 20 and 40 degrees C. The temperature was shown to have an impact on the shape of the ternary phase diagrams. Guided by the determined ternary phase diagrams, the pure PHBA-GA cocrystal could be prepared successfully by isothermal slurry conversion crystallization. Raman spectroscopy was employed to monitor the molecular recognition and self-assembly process of the conversion in situ. In addition, density functional theory calculations were conducted to determine the stability and interaction energy of the cocrystal, rationalizing the formation potential of the PHBA-GA cocrystal.