A 4.2 magnitude earthquake struck off the coast of Malibu, California, at about 2 a.m. on Wednesday, officials said.