wp_redirect is not working sometimes

As the docs say:

Note: wp_redirect() does not exit automatically, and should almost
always be followed by a call to exit;:

wp_redirect( $url );
exit;

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