Scheduling a cron job from a function that is ran outside functions.php?

Solved, although in a pretty poor manner.

If I move the scheduler function

wp_schedule_single_event( time() + 600, 'mail_event_hook' ); 

into functions.php it starts working. Not sure why, but this is the curse of self taught developers.

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