Change virtual server password whithout web pages stop working

Because my server have been hacked, I would like to change password for all virtual servers. For example I have a virtual server user.com. I go to “edit virtual server/configurable settings/set password to:” Everything it`s ok, but the web stop working. (joomla web)

My question is: how can I change password whithout any web damage.

Thank you.

I found it myself. Also I have change database password in configuration.php from joomla root (var $password). In the same file I`ve change var $smtppass for security reasons.

Also, you shouldnt use the root user for database access, but create a specific user with access rights to the database. Otherwise, when one site gets compromised and the hacker can read the configuration file, your root user is compromised.