Today, Tun Dr Mahathir Mohamad said Malaysia and China have had relations for 2,000 years. That would more or less have been during the height of the Roman Empire and around the time of the birth of Jesus Christ.
Actually, Malays first went to China to trade around 300 BC, which means 200 years before the rise of the Roman Empire.
China first started recording trade between the Malays as far as off the African Coast from 400-500 and Chinese records show the Malays trading in Africa since the year 100.
So the Malays were already trading with Africa and China since the time of the Roman Empire. By the year 800, the Malays were actively trading with China, who offered the Malays protection from Thailand during the Ming Dynasty.
During the Cold War, Malaysia broke off relations with China and Malaysians were banned from going to China (as well as to Cuba, USSR, Israel, South Africa, etc.) and China backed the CPM (Communist Party of Malaya) to topple the government.
In 1974, Malaysia established diplomatic relations with China when Tun Abdul Razak Hussein made his historic visit to China — and in 1989 the Peace Treaty between Malaysia and the CPM was signed in Hat Yai, Thailand.
So, yes, Malaysia and China did have good relations but it was only since 1974 — and it was because of Tun Razak. Before that, Malaysia and China were technically at war. It was Tun Razak who ended this cold war with China after the United States did in 1972.