The Messenger of Allah ﷺ forbade visiting graves. He then mentioned the same meaning, except that he said, "Beware of every intoxicant."
حدثناه عفان حدثنا حماد بن سلمة أخبرنا علي بن زيد عن ربيعة بن النابغة عن أبيه
نهى رسول الله ﷺ عن زيارة القبور فذكر معناه إلا أنه قال وإياكم وكل مسكر
No references are available.
Its isnad is daif, and it is a repetition of the one before it.