Can set_post_thumbnail be used to remove a thumbnail?

No, you can’t use set_post_thumbnail() to remove the post thumbnail. The function you need is delete_post_thumbnail().

// Both of these work.
delete_post_thumbnail( $post->ID ); // pass the post ID
//delete_post_thumbnail( $post );   // or post object

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