Calling calculate_shipping() with ajax in woocommerce

I also have the same issue when I created a shipping method and what I did is on my function for the ajax call I add something just to have an update on the cart:

global $woocommerce;
$packages = $woocommerce->cart->get_shipping_packages();
foreach( $packages as $package_key => $package ) {
    $session_key  = 'shipping_for_package_'.$package_key;
    $stored_rates = WC()->session->__unset( $session_key );
}

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