What function to hook for changes made in status and visibility of a post

What I was looking for was transition_post_status. The documentation can be found here.

What I did was to add one more filter add_filter('transition_post_status','myFunction');

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