Well, you answered it yourself. Your Knock Sensor has gone bad. I bet your check engine light comes on too. When your check engine light comes on and your transmission is all screwy that means your car is in fail safe mode. Not allowing you to shift into higher gears. Get the knock sensor replaced and re calibrated and your fine.
The 2006 Mazda MAZDA6 has a 5-speed manual.
The 2009 Mazda MAZDA6 has a 6-speed manual.
The 2004 Mazda MAZDA6 has a 5-speed manual.
The 2012 Mazda MAZDA6 has a 6-speed manual.
The 2005 Mazda MAZDA6 has a 5-speed manual.
The 2003 Mazda MAZDA6 has a 5-speed manual.
The 2011 Mazda MAZDA6 has a 6-speed manual.
The 2008 Mazda MAZDA6 has a 5-speed manual.
The 2015 Mazda MAZDA6 has a 6-speed manual.
The 2007 Mazda MAZDA6 has a 5-speed manual.
The 2010 Mazda MAZDA6 has a 6-speed manual.
The 2013 Mazda MAZDA6 has a 6-speed manual.