Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:19682Abū ʿAlī > Muḥammad b. Bakr > Abū Dāwud > Hārūn b. ʿAbdullāh > Muḥammad b. Bishr > Yūnus b. Abū Isḥāq > Mujāhid > Abū Hurayrah

[Machine] The Messenger of Allah ﷺ forbade the use of harmful medicine, and these two Hadiths are understood to prohibit the use of intoxicants for medical treatment or the use of any prohibited substance except in cases of necessity, in order to reconcile between them and the Hadiths of the Quran and Allah knows best.  

البيهقي:١٩٦٨٢وَأَخْبَرَنَا أَبُو عَلِيٍّ أنبأ مُحَمَّدُ بْنُ بَكْرٍ ثنا أَبُو دَاوُدَ ثنا هَارُونُ بْنُ عَبْدِ اللهِ ثنا مُحَمَّدُ بْنُ بِشْرٍ ثنا يُونُسُ بْنُ أَبِي إِسْحَاقَ عَنْ مُجَاهِدٍ عَنْ أَبِي هُرَيْرَةَ قَالَ

نَهَى رَسُولُ اللهِ ﷺ عَنِ الدَّوَاءِ الْخَبِيثِ وَهَذَانِ الْحَدِيثَانِ إِنْ صَحَّا فَمَحْمُولَانِ عَلَى النَّهْيِ عَنِ التَّدَاوِي بِالْمُسْكِرِ أَوْ عَلَى التَّدَاوِي بِكُلِّ حَرَامٍ فِي غَيْرِ حَالِ الضَّرُورَةِ لِيَكُونَ جَمْعًا بَيْنَهُمَا وَبَيْنَ حَدِيثِ الْعُرَنِيِّينَ وَاللهُ أَعْلَمُ