Show all posts by author

You should uncomment first line and add author query var.

 $wp_query->query_vars["author_name"] = "John";

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