How can I make internal anchor links work with WordPress’s permalinks?

Dumb question, but had you tried:

<a href="http://wordpress.stackexchange.com/shop/#product-name">Buy this product!</a>

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