Permalink options page corrupts web.config file

When visiting that page it would actually create an empty config file. To fix the issue, I copied the config file from my http://example.com/ directory to the http://example.com/wordpress/ one, it works fine now.

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