bonaca bonaca - 5 months ago 19
SQL Question

How to get mysql hostname on remote server

define('DBHOST','localhost');
define('DBUSER','root');
define('DBPASS','');
define('DBNAME','mozaik-matria');


The above is part of
├žonfig.php
and it works on localhost.
Moving on remote server I cannot find any info (using cpanel and phpMyAdmin) about
DBHOST
parameter.

I tried with pure url (
http://example.com/
) and subdomain (
http://subdomain.example.com/
) - without success:
SQLSTATE[HY000] [2005] Unknown MySQL server host...

Answer

In most of the server like godaddy. the hostname as localhost are work fine.

But you can use example.com as hostname.

And user name you can find from the database wizard. if username does not exist than you have to create user. And same for the database.

Exa:

define('DBHOST','example.com');
define('DBUSER','username');