Trying to require log in to view any post/pages/taxnomy

Much easier to use a simple plugin that has hooks and can allow for pages/posts to be accessible by the non-logged in public.
https://wordpress.org/plugins/wp-force-login/

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