An electrical connector includes an insulative housing having a front mating surface, a mounting surface, two opposite side surfaces, a plurality of conductive terminals secured in the housing, and at least one board lock secured in the insulative housing. A recess is formed in the mounting surface and defines a lower surface. At least one boardlock-receiving cavity is formed in the lower surface. Each board lock includes a body portion received in the recess and a pair of locking arms extending from two sides of the body portion and received in the boardlock-receiving cavity. The body portion defines an engaging surface coplanar with the mounting surface.