Do i need to keep register_post_type in functions.php?

Yes, you need to keep it within functions.php and within the init hook, as it will have to register each time. It’s not like with roles, where you can add it once and it’s saved in the database.

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