wp_insert_post causing There was an error connecting to the database: Access denied for user ‘root’@’localhost’ (using password: NO)

wp_insert_post causing There was an error connecting to the database: Access denied for user ‘root’@’localhost’ (using password: NO)

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