How make Autocomplete with wp_query in post_type attachment

How make Autocomplete with wp_query in post_type attachment

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