wordpress api using rest_route for other pages

Actually I was able to figure out with a little modification to Rank’s answer:

https://www.example.com/?rest_route=/wp/v2/posts&categories=12

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