The steady, viscous flow and mixed convection heat transfer of an incompressible electrically conducting fluid within a vertical cylindrical annulus with moving walls are investigated. This annulus is under the influence of a radial magnetic field and the fluid is suctioned/injected through the cylinders' walls. An exact solution of the Navier–Stokes equations and energy equation is derived in this problem where heat is transferred from the hot cylinder walls with constant temperature to the cooler moving fluid. The role of the movement of the annulus walls is studied on the flow and heat transfer of the fluid within the annulus, for the first time. The effects of other parameters, including Prandtl number, Hartman number, mixed convection parameter, suction/injection parameter and ratio of the radius, on the behavior of the flow and heat transfer of the fluid is also considered. The results indicate that if, for example, the internal cylinder wall moves in the direction of z-axis and the external cylinder is stationary, the maximum and minimum heat transfer occur on the walls of internal and external cylinders, respectively. Moreover, the augmentation of the radius ratio between the two cylinders increases the rate of heat transfer and decreases the shear stress on the wall of the internal and external cylinders, however, the results on the wall of external cylinder are exactly the reverse. Consequently, by changing the effective parameters used in this paper, the flow of the fluid can be controlled and the heat transfer of the fluid can be improved.