How to check if a post “does not have term” in conditional statement?

if ( !has_term('term', 'taxonomy', $post->ID )) {

Use the NOT (!) operator

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