Due to size reasons, current common flow rate sensors can only be inserted into pipes with larger diameters to measure liquid flow rate. To be placed into a micro pipeline, a cylinder thermal resistance micro-electromechanical system(MEMS) flow sensor with temperature compensation was designed and fabricated. It is composed of a heating resistor and a temperature-measuring resistor to measure the flow rate through the working principle of heat loss. The experimental results show that the temperature coefficient of resistance(TCR) is 0.22 %/℃ and the sensitivity was 4.25 mV/(cm.s-1). The designed circuits demonstrate an excellent effect of temperature compensation for accurate measuring results. The proposed flow sensor can measure the flow rate in a pipe with an inner diameter of 2mm, with high measurement accuracy, and is expected to be applied to the industrial, biomedical, and other fields.