How to fix URL with pageid example /?p= too many redirection error

In case someone looking for answers in the future, I have solved the issue by searching for

add_filter('redirect_canonical'

in all the plugins and found the culprit.

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