How do i schedule cron in wordpress for each second?

I do not think it is useful to have a cron running every second, but the function itself is quite simple.

You add a filter to the cron_schedules:

function f711_add_seconds( $schedules ) {
    $schedules['everysecond'] = array(
        'interval' => 1,
        'display' => __('Every Second')
    );
    return $schedules;
}
add_filter( 'cron_schedules', 'f711_add_seconds' ); 

You can now use everysecond in your wp_schedule_event instead of the hourly.

Note that the Cron is not executed every second, if nothing happens on your site, but it will be limited to max. one execution per second. Cron sets a value in your options-table for a timestamp when the function should be executed the next time. Then Cron checks if the time is in the future or in the past, and if it is in the past, the function is executed. The Cron runs automatically at this point but needs to be set again. So be sure to include the

if ( !wp_next_sceduled('my_event') ) { /* scheduling code */ }

in your code.

For further information on how Cron works visit the Codex Page.

You should not overwrite the hourly as you did, as some functions may use this schedule. Please be aware that some Plugins may clear your Cronschedule, if they are not coded properly (had a Caching Plugin like that once).

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