Specified file failed upload test. Error When Uploading Image From Front-end

Check the documentation wp_handle_upload
You need to include the file.php before calling wp_handle_upload

require_once( ABSPATH . 'wp-admin/includes/file.php' )

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