How to pre populate a form field with a link of a current user’s author profile?

<?php 

$currentUser = get_current_user_id();   //get  currently logged user ID  

$user = get_user_by( 'id', $currentUser );   // Get the user Object by id

$userUrl = get_bloginfo('home').'/author/'.$user->user_login; //Formulate the outout 

echo $userUrl; //echo the output 
?>

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