To study and compare the medication regularities of traditional Chinese medicine formulas(TCMFs) for the six kinds of pains,namely abdominal pain,headache,epigastric pain,hypochondriac pain,heartache and backache,using a data-mining approach,in order to provide reference for relevant studies for the compatibility mechanism and new compound development of related TCMFs. A total of 2 443 TCMFs for pains were collected from the Dictionary of Chinese Medicine Prescriptions,and analyzed using the Apriori algorithm based on three indicators,namely confidence,lift and support,so as to study pivotal traditional Chinese medicines(TCMs) for each pain and their compatibility regularities. The results showed that deficiency tonifying medicines(such as Glycyrrhizae Radix et Rhizoma and Angelicae Sinensis Radix),Qi-regulating medicines(like Aucklandiae Radix) and blood circulation promoting medicines(like Chuanxiong Rhizoma) were commonly used TCMs for pains. However,there were many differences between drugs for various kinds of pains. For example,Magnoliae Officinalis Cortex was used frequently for abdominal pain and epigastric pain,while Saposhnikoviae Radix was used frequently for headache. The latent association rules with significant lift included Carthami Flos → Angelicae Sinensis Radix for abdominal pain,Astragali Radix → Glycyrrhizae Radix et Rhizoma for headache,Hordei Fructus Germinatus → Citri Reticulatae Pericarpium for epigastric pain,Gentianae Radix et Rhizoma → Bupleuri Radix for hypochondriac pain,and Caryophylli Flos → Moschus for backache. This study showed that based on the TCMFs from the Dictionary of Chinese Medicine Prescriptions,the data-mining approach can reveal the differences and similarities in the use of TCMs for the six kinds of pains,and discover the latent composition regularities of relevant TCMs.