Sunan Ibn Majah, Volume 5, Book 34, Hadith 3833 (DarusSalam)

It was narrated that Abu Hurairah said: "The Messenger of Allah (saas) used to say: 'Allahummanfa'ni bima 'allamtani, wa 'allimni ma yanfa'uni, wa zidni 'ilman, wal-hamdu lillahi 'ala kulli hal, wa a'udhu billahi min 'adhabin-nar (O Allah, benefit me by that which You have taught me, and teach me that which will benefit me, and increase me in knowledge. Praise is to Allah in all situations, and I seek refuge with Allah from the torment of the Fire).'"

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، عَنْ مُوسَى بْنِ عُبَيْدَةَ، عَنْ مُحَمَّدِ بْنِ ثَابِتٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ يَقُولُ ‏ "‏ اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي وَعَلِّمْنِي مَا يَنْفَعُنِي وَزِدْنِي عِلْمًا وَالْحَمْدُ لِلَّهِ عَلَى كُلِّ حَالٍ وَأَعُوذُ بِاللَّهِ مِنْ عَذَابِ النَّارِ ‏" ‏ ‏.‏

sunnah.com