Finding a post’s slug

The slug is already in the post object, it’s $post->post_name.

And as you observed, yes, the way to get the post link is get_permalink( $post->ID );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)