How to target post and pages and not all post types in admin?

You just need to change the get_post_types( '', 'names' ) to array( 'post', 'page' ). I.e. Manually specify the post types.

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