Looking for a better way to initiate cron job

Simply check if the event is scheduled, and if not, schedule it:

add_action(
    'init',
    function () {
        if ( ! wp_next_scheduled( 'my_scheduled_event' ) ) {
            wp_schedule_event( time(), 'hourly', 'my_scheduled_event' );
        }
    }
);

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