Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?

Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?

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