localhost instead of domain |
[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
[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
[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’];
[eluser]rcahanap[/eluser]
Hello Aken! Thanks for responding. Let me click on that link and read then. -Roberto
[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
[eluser]Aken[/eluser]
If it didn't work, then it clearly is not the correct hostname Domain name and MySQL hostname are two different things.
[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. |
Welcome Guest, Not a member yet? Register Sign In |