Programmatically adding product attributes to WP / Woo commerce

I think I have answer to my own question.
After loading data into wp_woocommerce_attribute_taxonomies as part of the function detailed above, it is necessary to create serailised array of attributes and their meta data, and post it into wp_options.As far as I can tell wp_options contains a range of transient data used by wordpress as a way to improve performance.

The following query seems to do the trick.

/*
ATTRIBUTES
---------------
Post an entry into wp_options
option_name = "_transient_wc_attribute_taxonomies"
This record is used to populate the ADMIN AREA -> Products -> Attributes interface
.. and appears to be used to post attribute values to screen in the web -> products list pages
*/
SET SESSION group_concat_max_len=10000;
SET @RowNo = -1;

INSERT INTO `wp_options` (`option_name`,`option_value`, `autoload`)
SELECT * FROM
(
SELECT
"_transient_wc_attribute_taxonomies" AS `New_Option_Name`,
CONCAT("a:",COUNT(*),":{",
GROUP_CONCAT(option_value SEPARATOR ""),
"}") AS New_Option_Value, "yes" AS `New_Autoload`
FROM
(
SELECT
CONCAT(
"i:",(@RowNo := @RowNo + 1),";O:8:","""","stdclass","""",":6:"
,"{S:12:","""","attribute_id","""",";s:",LENGTH(attribute_id),":","""",attribute_id,"""",";"
,"S:14:","""","attribute_name","""",";s:",LENGTH(attribute_name),":","""",attribute_name,"""",";"
,"S:15:","""","attribute_label","""",";s:",LENGTH(attribute_label),":","""",attribute_label,"""",";"
,"S:14:","""","attribute_type","""",";s:",LENGTH(attribute_type),":","""",attribute_type,"""",";"
,"S:17:","""","attribute_orderby","""",";s:",LENGTH(attribute_orderby),":","""",attribute_orderby,"""",";"
,"S:16:","""","attribute_public","""",";s:",LENGTH(attribute_public),":","""",attribute_public,"""",";}"
) AS option_value
FROM `wp_woocommerce_attribute_taxonomies` 
) Calculated_values
) Formatted_Values
ON DUPLICATE KEY UPDATE option_value = Formatted_Values.New_Option_Value;

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