Shakhriyar's parents are from the Zangilan District of Azerbaijan, which is now occupied by Armenia. In 1980, his family moved to the then-flourishing industrial city ofSumqayit, Azerbaijan, where Shakhriyar was born. His first chess trainer was his father, who is also a former boxer and taught boxing to Shakhriyar for some time. Mamedyarov has two sisters, Zeinab Mamedyarova and Turkan Mamedyarova, who are Woman Grandmasters. Mamedyarov got married in 2012, but got divorced for unknown reasons. He remarried in July 2017.
In 2003 he won the World Junior Chess Championship. He repeated his victory in 2005, becoming the only two-time champion, achieving a 2953 performance rating after eight rounds, earning an invitation to the Essent Tournament 2006 in Hoogeveen, and after winning this and the 2007 edition, Mamedyarov achieved world fame. In 2005 Mamedyarov competed at the European Club Cup and had the second-highest performance rating, after Vassily Ivanchuk, of all of the participants. Mamedyarov attained joint first place at the Aeroflot Open in Moscow in February 2006, with a score of 6½/9. In May he won the combined FiNet/Ordix rapid event. In October 2006, he won the closed Essent Chess Tournament in Hoogeveen with 4½/6, beating Judit Polgár on Sonneborn-Berger tie-breaks. At the Chess World Cup 2007 Mamedyarov reached the third round where he was knocked out by Ivan Cheparinov. In 2008 he won the Corsican Circuit rapid knockout. In 2009 he won the Mainz Ordix Open with 10/11. In 2010, he tied for first place with Vladimir Kramnik and Gata Kamsky at the President's Cup in Baku, followed by joint first in the Tal Memorial. In June 2013, Mamedyarov won the World Rapid Chess Championship, scoring 11½/15. The next month he won the Geneva Masters rapid event. In November 2014, he won the Tal Memorial for the second time. In June 2016, Mamedyarov won the 3rd Shamkir Chess Tournament, the Vugar Gashimov Memorial. He defeated both top seeds Fabiano Caruana and Anish Giri in the last two rounds, which put him in a tiebreak situation with Caruana. He defeated Caruana in the tiebreak, thus giving him tournament victory. In April 2017, Mamedyarov won the Vugar Gashimov Memorial for the second year in a row with a score of 5½/9. In April 2018, he participated in the fifth edition of the Gashimov Memorial, finishing fourth with a score of 4½/9. From 28 May to 7 June 2018, he competed in the sixth edition of Norway Chess, placing seventh with 3½/8. From 22nd July 2018 to 1st August, he competed in the 51st Biel Chess Festival, winning the event by one-and-a-half points ahead of Magnus Carlsen. In 14 June 2020 Mammadyarov won Sharjah online Chess tournament with 7.5 points from 10 rounds which is his first online tournament win. In 26 June 2020 Mammadyarov placed 2nd-6th in the 1st Mukhtar Ismagambetov Memorial along with Nodirbek Abdusattorov, Dmitriy Bocharov, Kazybek Nogerbek, and Davit Maghalashvili, with a score of 8.5/11.
He played for Azerbaijan at the Chess Olympiads of 2000, 2002, 2004, 2008, 2010, 2012, 2014, 2016 and 2018. In 2009,2013 and 2017 he won the team gold medal for Azerbaijan at the European Team Chess Championship, having won the bronze medal in 2007 and silver in 2011.