Five pitchers have done it. This ESPN article from April 14, 2012 lists the following three occurrences:
10 -- Tom Seaver, N.Y. Mets vs. San Diego, April 22, 1970
9 -- Ricky Nolasco, Florida at Atlanta, Sept. 30, 2009
9 -- Aaron Harang, L.A. Dodgers vs. San Diego, April 13, 2012
Then on September 27, 2012, Doug Fister of the Detroit Tigers struck out 9 straight Kansas City Royals batters. (link)
Then on October 3, 2015, Max Scherzer of the Washington Nationals struck out 9 straight New York Mets while throwing a no-hitter. (link)
Aaron Harang's nine straight strikeouts on April 13, 2012 came in the first 3 innings, after he gave up a single to the leadoff batter in the first inning. (link)