WordPress subdomain wp-admin redirects to main domain

Based on Charles Clarkson’s comment, I directly changed the siteurl and home options in the wp_options table to be https://dev.example.com/ and this fixed the problem for me.

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