Outside the loop Category name with link

You need to echo your link:

<a href="https://wordpress.stackexchange.com/questions/54801/<?php echo esc_url( get_category_link("23') ); ?>">
    <?php echo get_the_category_by_id(23); ?>
</a>

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