Recent Comments from Specific Category Widget

You could get your answer from Kovshenin blog

Replace whole if ( $comments ) with this

if ( $comments ) {
    foreach ( (array) $comments as $comment) {
    $comm_post_id = $comment->comment_post_ID;
    if ( $category_name ) {
        if (!in_category( "{$category_name}", $comm_post_id )) {
            continue;
        }
    }
    $output .=  '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
    }
}

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