How to debug register_setting callback function

The dirty and only way I’ve founded:

function myplugin_validate_options($input) {
    var_dump($input);
    exit;

}

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