Pagination not working in custom loop WP_Query

Having same problem. Ended up with the following codes

global $woocommerce_loop;
$woocommerce_loop['paged'] = (isset($woocommerce_loop['paged'])) ? $woocommerce_loop['paged'] : 1;
$woocommerce_loop['total'] = $custom_query->found_posts;
$woocommerce_loop['post_count'] = $custom_query->post_count;
$woocommerce_loop['per_page'] = $per_page;
$woocommerce_loop['total_pages'] = ceil($custom_query->found_posts/$per_page);
$woocommerce_loop['current_page'] = $args['paged'];

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