How to display post based on which is clicked

In the sidebar, replace this:

<a href=""><?php  the_title();  ?> </a> 

with this:

<a href="https://wordpress.stackexchange.com/questions/252150/<?php the_permalink(); ?>"><?php  the_title();  ?> </a> 

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