How can I safely delete data related to wp_post table manually from the mysql database?

As you already deleted all the posts in the table, this is going to be quite a bit of work manually.

For the next time you do something like that, use wp_delete_post( $postid, $force_delete ); (Codex) while looping through all the posts with that posttype, as this function deletes all the data associated with that post.

$args = array(
    'posttype' => 'yourposttype',
    'numberposts' => -1
);
$todelete = get_posts( $args );

foreach( $todelete as $deletethis ) {

    wp_delete_post( $deletethis->ID, true );

}

In your case, you will have to check the following tables for data (I skip the tableprefix here):

  • posts (which you already did)
  • postmeta
  • comments/commentmeta
  • term_relationships

In all cases you will have to search for entries with the post_id/object_id NULL or with no entry in the posts table, and delete them. The SQL should be pretty straight forward.