htaccess and htpasswd

Your behavior is logical. the profile.php page is in the protected /wp-admin/ folder.
the wp-login.php is in the root (/), which is not protected.

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