Let’s say that we have a Codeigniter installation and the way to access that installation/website is subdomain.domain.com
In the database config of Codeigniter, what should the hostname variable be?
I tried the two below but I am still unable to connect to the database.
$db['default']['hostname'] = 'localhost';
$db['default']['hostname'] = 'subdomain.domain.com';
NOTE: I am sure that the username and password details are correct.
NOTE2: Does using subdomains counted as external source by MySQL? If yes, should I then turn on the option in MySQL to accept external request? Not sure if this is relevant.
Try setting it to the ip address of the server. That’s how I always configure mine.