cannot create product attribute (taxonomy) and add terms on the same execution

In the end I added a quick check with

taxonomy_exists($slug)

and if it doesn’t exist before adding the terms I use

register_taxonomy($taxonomySlug, 'product')

This seems to have allowed creation of all terms in one go.

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