![]() |
localhost instead of domain - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: localhost instead of domain (/showthread.php?tid=53455) |
localhost instead of domain - El Forum - 07-24-2012 [eluser]rcahanap[/eluser] New to setting up configs for mysql /code igniter. In the application/config/database.php file, there is a default variable ('hostname') that you can set. I had mine set like this: $db['default']['hostname']="biboba.com"; But I was getting errors. I changed it to this, and it was OK: $db['default']['localhost']; Can someone explain what's the difference? According to the docs: ['hostname'] The hostname of your database server. But this is not working. Thank you in advance for your replies. -Roberto localhost instead of domain - El Forum - 07-24-2012 [eluser]Aken[/eluser] The hostname is the host server where the MySQL database is installed. "localhost" is the most common hostname, but is not always the correct value. http://dev.mysql.com/doc/refman/5.0/en/connecting.html localhost instead of domain - El Forum - 07-25-2012 [eluser]sith4life[/eluser] go into /application/config/database.php and edit Code: $db['default']['hostname'] = 'localhost'; // this is dependent on your webhost Code: $db[‘default’][‘localhost’]; localhost instead of domain - El Forum - 07-25-2012 [eluser]rcahanap[/eluser] Hello Aken! Thanks for responding. Let me click on that link and read then. -Roberto localhost instead of domain - El Forum - 07-25-2012 [eluser]rcahanap[/eluser] Hello sith4life! I meant to say, I had this: $db['default']['hostname'] = "localhost"; That worked. The "explanation" of the variables said: ['hostname'] The hostname of your database server. The hostname is "dblogix.com". But when I tried that, it did not work. -Roberto localhost instead of domain - El Forum - 07-25-2012 [eluser]Aken[/eluser] If it didn't work, then it clearly is not the correct hostname ![]() localhost instead of domain - El Forum - 07-26-2012 [eluser]sith4life[/eluser] yea the docs are assume you understand that you know the difference between a MySQL Hostname and a webhost. "localhost" in your case is synonymous with "dlblogix.com" but CI will look in your root directory for the Database and not find it because it's on a different part of the server. I hope this makes sense. |