We aim to investigate the physical and chemical properties of the molecular envelope of the oxygen-rich AGB star IK Tau. We carried out a millimeter wavelength line survey between ~79 and 356 GHz with the IRAM-30 m telescope. We analysed the molecular lines detected in IK Tau using the population diagram technique to derive rotational temperatures and column densities. We conducted a radiative transfer analysis of the SO2 lines, which also helped us to verify the validity of the approximated method of the population diagram for the rest of the molecules. For the first time in this source we detected rotational lines in the ground vibrational state of HCO+, NS, NO, and H2CO, as well as several isotopologues of molecules previously identified, namely, C18O, Si17O, Si18O, 29SiS, 30SiS, Si34S, H13CN, 13CS, C34S, H234S, 34SO, and 34SO2. We also detected several rotational lines in vibrationally excited states of SiS and SiO isotopologues, as well as rotational lines of H2O in the vibrationally excited state ν2=2. We have also increased the number of rotational lines detected of molecules that were previously identified toward IK Tau, including vibrationally excited states, enabling a detailed study of the molecular abundances and excitation temperatures. In particular, we highlight the detection of NS and H2CO with fractional abundances of f(NS)~10-8 and f(H2CO)~[10-7-10-8 ]. Most of the molecules display rotational temperatures between 15 and 40 K. NaCl and SiS isotopologues display rotational temperatures higher than the average (~65 K). In the case of SO2 a warm component with Trot~290 K is also detected. With a total of ~350 lines detected of 34 different molecular species (including different isotopologues), IK Tau displays a rich chemistry for an oxygen-rich circumstellar envelope. The detection of carbon bearing molecules like H2CO, as well as the discrepancies found between our derived abundances and the predictions from chemical models for some molecules, highlight the need for a revision of standard chemical models. We were able to identify at least two different emission components in terms of rotational temperatures. The warm component, which is mainly traced out by SO2, is probably arising from the inner regions of the envelope (at ≲8R∗) where SO2 has a fractional abundance of f(SO2)~10-6. This result should be considered for future investigation of the main formation channels of this, and other, parent species in the inner winds of O-rich AGB stars, which at present are not well reproduced by current chemistry models.