Restricted access for other user roles

Actually its very simple ex:

// only administrator
if ( ! current_user_can('manage_options') ) {
    add_action( 'admin_menu', 'remove_woocommerce_menu_pages', 999 );
    function remove_woocommerce_menu_pages() {
        remove_submenu_page('woocommerce', 'woocommerce_settings');
    }
}

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