The 26-year-old has signed a three-year deal through to the summer of 2025.
Forest reportedly agreed a deal worth £8.6m plus £4.2m in add-ons to Mainz.
"For me, this a dream to come to England and to sign for such a historic club in Nottingham Forest," said the centre-back.
"The club is well known around the world and its fans are incredible."
Niakhate, who spent three years with Mainz, has been capped by France at under-19 through to under-21 level.