WordPress 4.4.2 Update not working

I had to change the ownership of the directory

Current Ownership was
username:www-data

Changed it to
www=data:www-data

after this it’s not asking for my ftp password anymore and update is working with just one click

Reference

https://wordpress.org/support/topic/plugin-install-asks-for-ftp-details

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