Is there a way to add ajax hooks without editing the functions.php file?

Is there a way to add ajax hooks without editing the functions.php file?

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