adding custom code as a wordpress plugin

You need to hook into that action, not repeat it. I believe you want something like this. The function will fire with the validate_password_reset

add_action( 'validate_password_reset', 'my_passwd_function', 10, 2 );

function my_passwd_function() {

    echo 'Your Code Here';
    return;

}

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