set cookies for my whole site is not working

in domain Name I’ve used this

$urlOfSite =  get_option('home');
$url = parse_url($urlOfSite, PHP_URL_PATH);

url path . This is working for me .

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