Adaptation of the bacterial community to mercury contamination