Create a CSS file in plugin folder when theme is activated

Take a look at after_switch_theme link

But I would use hooks to insert the css for example in wp_head

This link helps you get the directory of the theme, so you can create the css afterwards.

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