A preliminary 5.2-magnitude earthquake struck near Bakersfield and shook all the way to Los Angeles County.