We have investigated experimentally the influence of a magnetic interaction between the grains on the compaction dynamics of a granular pile submitted to a series of taps. The granular material used to perform this study is a mixture of metallic and glass grains. The packing is immersed in an homogeneous external magnetic field. The magnetic field induces an interaction between the metallic grains that constitutes the tunable cohesion. The compaction characteristic time and the asymptotic packing fraction have been measured as a function of the Bond number which is the ratio between the cohesive magnetic force and the grain weight. These measurements have been performed for different fractions of metallic beads in the pile. When the pile is only made of metallic grains, the characteristic compaction time increases as the square root of the Bond number. While the asymptotic packing fraction decreases as the inverse of the Bond number. For mixtures, when the fraction of magnetized grains in the pile is increased, the characteristic time increases while the asymptotic packing fraction decreases. A simple mesoscopic model based on the formation of granular chains along the magnetic field direction is proposed to explain the observed macroscopic properties of the packings.