The Hebrew word "yada" refers to intimate relational knowledge gained through experience, such in Genesis 4:1, Adam knew (yada) Eve, she conceived, and gave birth to Cain. The whole Bible is essentially about building of kingdom of citizens who yada God by walking in His way through spreading the Gospel in accordance with the promise. In Genesis 18:19, God knew (yada) Abraham that he would teach his children and those of his household to walk in God's way by doing righteousness and justice that the Lord may bring to him all that He has promised, which is a lynchpin verse for the entire Bible.
In Exodus 33:13, Moses wanted God to be gracious to him by teaching him to walk in His way that he and Israel might know (yada) Him, in 1 Kings 2:1-3, God taught how to walk in His way through the Mosaic Law, and in John 17:3, eternal life is knowing God and Jesus. In Jeremiah 9:3 and 9:6, they did not know (yada) God and refuses to now Him because in 9:13, they had forsaken the Mosaic Law, while in 9:24, those who know God know that. He delights in practicing steadfast love, justice, and righteousness in all of the earth, so delighting in practicing those and other aspects of His nature by walking in God's way in obedience to the Mosaic Law is the way to know God and Jesus, who is the exact image of God's nature (Hebrew 1:3), In 1 John 2:6, those who say that they know Jesus, but don't obey His commands are liars, which is because his commands are His instructions for how to know him. In 1 John 3:4-6, those who continue to practice sin in transgression of the Mosaic Law have neither seen nor known him. In Matthew 7:23, Jesus said that he would tell those who are workers of lawlessness to depart from him because he never knew them.
So yes, God did teach the Israelites how to have an intimate relationship with Him through giving them the Mosaic Law. The Mosaic Covenant is often described in terms of being a marriage between God and Israel, so having an intimate relationship with God is the entire point of the Mosaic Law.
Enoch walked with God because God taught Him to obey His law for how to walk in His way. Likewise, in Genesis 6:8-9, Noah found grace in the eyes of God, he was a righteous man, and he walked with God, so God was gracious to him by teaching him to walk in His way in obedience to His law and he was righteous because he obeyed through faith. In Genesis 26:5, Abraham heard God's voice and guard His charge, His commandments, His statutes, and His laws. The way that Micah taught to walk humbly before God was to walk in His way in obedience to His law. The way to interact with God is by practicing his nature by walking in His way in obedience to His law. The Mosaic Law is God's way (Psalms 119:1-3), the truth (Psalms 119:142), and the life (Deuteronomy 32:46-47), and the way to see and know the Father (Exodus 33:13), and Jesus embodied the Mosaic Law by expressing the divine nature through living in sinless obedience to it, so he is the embodiment of the way, the truth, and the life, and the way to see and know the Father (John 14:6-7).
Jesus never criticized the law as being a failed method, which would imply that God failed for instructing a failed method for having an intimate relationship with God and he never criticized the Pharisees for obeying it, but he did criticize them for not obeying it or for not obeying it correct. For example, in Mark 7:6-9, Jesus criticized them as being hypocrites for setting aside the commands of God in order to establish their own traditions. In Matthew 23:23, Jesus said that tithing was something that they ought to be doing while not neglecting weightier matters of the law of justice, mercy, and faithfulness are weightier matters of the law, so he was not opposing their obedience to it as a way of having an intimate relationship with God, but rather he was calling them to have a higher level of obedience to the Mosaic Law in a manner that is in accordance with its weightier matters, which is the way to have an intimate relationship with God.
In Matthew 4:15-23, the Gospel that Jesus taught called for our obedience to the Mosaic Law, which is the same Gospel that he commissioned his disciples to bring to the nations. In Titus 2:14, Jesus gave himself to redeem us from all lawlessness and to purify for himself a people of his own possession who are zealous for doing good works, so becoming zealous for doing good works in obedience to the Mosaic Law is also the way to believe in him and him crucified (Acts 21:20).