Where is custom template file chosen for a post stored in the DB?

It’s in the post meta table (usually wp_postmeta), with the page id in post_id, meta_key with _wp_page_template and meta_value with the template file name.

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