todd_temple — 2009-05-10T21:51:03-04:00 — #1
I have setup a new account through a reseller that supplies a shared IP. The way I have installed WordPress in the past is to use "localhost" as the MySQL database host name.
The problem is that I want to complete the installation and style the site before I transfer the domain name and propagate the DNS settings. I am currently receiving errors that say "Error establishing a database connection".
I have also tried several variations of the shared IP address in place of the "localhost". So instead of using "localhost" I have tried using the link if I were to preview the site, for example http://126.96.36.199/~site/.
Can someone tell me if it is possible to replace the string entry of "localhost" with a number or something else so that I can complete the installation of WordPress?
felgall — 2009-05-10T22:04:01-04:00 — #2
If you are running Windows then you need to find a file called hosts (without an extension). You can enter the IP address and the domain name in there so that your computer associates the domain directly with that address without it having to wait to propogate.
todd_temple — 2009-05-10T22:10:57-04:00 — #3
I am thinking that I may not have access to that file. It is a reseller account through Host Gator. I believe that the web host manager configures those settings automatically... but I am not sure.
Any other suggestions?
ldcdc — 2009-05-11T05:09:52-04:00 — #4
He was talking about the "hosts" file on your PC: http://en.wikipedia.org/wiki/Hosts_file.
Your database server is still localhost. It is is installed on the same machine.
Have you created a database and a database username on the server? You can login to cPanel and do that via http://IPaddress/cpanel
Maybe you made a typo somewhere?
todd_temple — 2009-05-11T08:11:56-04:00 — #5
I have created the database, a database user and password and then added the user to the database. Then I plugged in the info into the configuration file... leaving the localhost entry as is. When it didn't work, I assumed that it was the localhost entry, since I had added a new site to the HostGator web host manager before the domain name has been transferred.
In other words, I wanted to install and style the WordPress before switching over the domain name from a third party. But in the HostGator web host manager, when creating the new account, I have added the actual domain name for the account that will be transferred once I have the WordPress the way I want it.
Am I making since?
chieflee — 2009-05-13T11:44:20-04:00 — #6
You need to edit the hosts file on your local computer to set the ip of your hostgator server to the name that you want to access. That will allow name resolution for virtual hosting to work so you can get to the wordpress install wizard.
Log into hostgator setup the new domain (It doesnt matter if anyone else can access the site there yet.)
Create your database.
On your computer edit your hosts file, /etc/hosts if your running linux or C:/windows/system32/drivers/etc/hosts if your on windows
put in an entry like this
xxx.xxx.xxx.xxx www.domain.com domain.com
where the x is replaced with your host gator ip address and where domain.com is your domain
Drop wordpress in on your hostgator account and then visit www.domain.com (you might need to close all instances of your browser then open it again after making the hosts file change as some browsers will cache the ip of the previous look up for a while.
Hope that helps
todd_temple — 2009-05-13T11:49:56-04:00 — #7
How about if I am on a Mac?
chieflee — 2009-05-13T12:00:14-04:00 — #8
I believe it is also /etc/hosts