No, you must to set the database hostname to the database server name.
You can find the database server name by clicking the MySQL Databases icon within your Control Panel.

The server name will be displayed before the database name, and username.
Why we don't use localhost
'localhost' generally means the MySQL databases are hosted on the same server as the websites, which is quite common in the web hosting industry, with hosts that have a 'single-server' approach where all services run from the same machine.
We are different because we split all services and have a strict 'one server, one rule' policy.
At the data centres, web traffic, MySQL traffic and storage are all physically different machines, so 'localhost' just can't work.
