No, that's a myth.
According to noted archeologists Mark Lehner and Zahi Hawass, the pyramids were not built by slaves; Hawass's archeological discoveries in the 1990s in Cairo show the workers were paid laborers, rather than slaves. Rather, it was farmers who built the pyramids during flooding, when they could not work their lands.