wp_before_admin_bar_render action not working in back office

Short answer, but you have a !is_admin() condition. That will prevent the bulk of that code from running on the back end. Remove that and the code should work on both front and back.

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