I'd like to make that all my posts in the category A belong also to category B (so after that they would belong both to A and B), is there any plugin or MySQL query that could allow me to do that easily?
You can bulk edit posts in the admin. I have never tried more than 500 or so but you can display 999 per page. To have more than the default 20 click screen options.
Click posts-->filter by Category A