CodeIgniter Forums
About the hostname for mysql - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: About the hostname for mysql (/showthread.php?tid=62434)



About the hostname for mysql - drhowarddrfine - 07-14-2015

The hostname of my system is "bob" when I echo $hostname. So I set up mysql and database.conf with that hostname. Now I read that, typically, mysql will use 'localhost' as the hostname.

Since I'm having "blank page" problems with CI 2.1.3, could I have messed things up by doing that with the hostname? On top of that, I've forgotten how I set mysql to that hostname in the first place (or did it get it from the system?).


RE: About the hostname for mysql - twpmarketing - 07-14-2015

(07-14-2015, 01:14 PM)drhowarddrfine Wrote: The hostname of my system is "bob" when I echo $hostname. So I set up mysql and database.conf with that hostname. Now I read that, typically, mysql will use 'localhost' as the hostname.

Since I'm having "blank page" problems with CI 2.1.3, could I have messed things up by doing that with the hostname? On top of that, I've forgotten how I set mysql to that hostname in the first place (or did it get it from the system?).

It could be as simple as setting the hostname in the CI configuration:

 /application/config/database
Code:
...
    'hostname' => 'localhost',
...
That should point to IP 127.0.0.1 on your local server (not your system)


RE: About the hostname for mysql - drhowarddrfine - 07-14-2015

I forgot to say, the server is in a VM, virtualbox, on the same machine.


RE: About the hostname for mysql - twpmarketing - 07-14-2015

(07-14-2015, 02:10 PM)drhowarddrfine Wrote: I forgot to say, the server is in a VM, virtualbox, on the same machine.

I've not used a VM (no room on this system) so I can't address that.

I also assume your server is running Apache, I could be wrong...

Scratch that, I see from your earlier thread that you're running NginX.
The config should be similar, at least on the CI side.


RE: About the hostname for mysql - CroNiX - 07-14-2015

Is the database hosting on the VM? Do you have port forwarding set up? Do you have an entry on the HOST machine's hosts file to point to the vm? "bob" points to VM's public IP?