how to make the link of comment section “nofollow” safely?

to customise the link “You must be logged in”, you can use that in your template :

comment_form([
    "must_log_in" => "<a href=\"https://wordpress.stackexchange.com/questions/18007/\">a question about unicorns</a>",
]);

other arguments are detailed in the official documentation :
https://developer.wordpress.org/reference/functions/comment_form/

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