After creating your database, you can find its details, including its hostname, in your control panel.
Your Database names, as well as your Users display.
cPanel hosting accounts host databases on the same server as your website; use the following to connect:
localhostas the host name.
If you cannot log in to your database, reset one of the database's user's passwords by clicking the user's name you want to use, resetting the password, and then clicking Change Password.