The MySQL query below will add my-custom-field with value “hello” to all published posts.
INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT wp_posts.ID, 'my-custom-field', 0 FROM wp_posts WHERE wp_posts.post_status = 'publish' AND wp_posts.post_type='hello';
Note
Fields that already have custom field my-custom-field will get another one. (So they will have 2 in total.)