unable to stop loop when using wp_insert_post with publish_post hook

The wp_insert_post() function triggers the publish_post hook again leading to an infinite loop. Try this change:

remove_action('publish_post', 'copy_post_to_blog');
wp_insert_post($post);
add_action('publish_post', 'copy_post_to_blog');

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