Abu Huraira said that the Prophet visited his mother’s grave and wept and caused those around him to weep. He then said, "I asked my Lord's permission to pray for forgiveness for her, but I was not allowed; I then asked His permission to visit her grave and I was allowed; so visit graves, for they make one mindful of death.”
Buraida reported God's messenger as saying, “I forbade you to visit graves, but you may now visit them; I forbade you to eat the flesh of sacrificial animals after three days, but you may now keep it as long as you feel inclined; and I forbade you nabidh except in a water-skin, so you may drink it from all kinds of water-skins, but you must not drink anything intoxicating.”
Buraida said that God's messenger used to teach them to say when they went out to the cemeteries, “Peace be upon you, inhabitants of the dwellings who are of the number of the believers and the Muslims. If God will, we shall join you. We ask God to grant us and you wellbeing.”
Umm ad-Darda’ said she heard Abud Darda’ say he heard Abul Qasim (i.e the Prophet) say that God who is blessed and exalted said, “I am sending after your time, Jesus, a people who will praise God when what they like happens to them, and seek their reward from God and show endurance when what they dislike afflicts them, though they do not possess forbearance and intelligence.” He asked, “My Lord, how can this be when they do not possess forbearance or intelligence?” God replied, “I shall give them some of my forbearance and my knowledge.”
Baihaqi transmitted the two traditions in Shu'ab al-lman.