WordPress folder ownership issues

you can run something like

sudo chown -R myusername:www-data public_html

it will solve both the problems together

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