Handling duplicates with wp_insert_term()

if ( is_wp_error($term_id) ) {

  // oops WP_Error obj returned, so the term existed prior
  // echo $term_id->get_error_message();
}

See if that works for you.

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