Custom link for wp_insert_post

You can use post_name parameter.

$my_post = array(
    'post_title'    => wp_strip_all_tags( $_POST['post_title'] ),
    'post_content'  => $_POST['post_content'],
    'post_status'   => 'publish',
    'post_author'   => 1,
    'post_category' => array( 8,39 ),
    'post_name'     => 'your-url'
 );
wp_insert_post( $my_post );

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