How Do I Install Wordpress Before My DNS Settings Propagate?

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

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?

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.

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?

He was talking about the “hosts” file on your PC:

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?

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?

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.

So …
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
where the x is replaced with your host gator ip address and where is your domain
Drop wordpress in on your hostgator account and then visit (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

How about if I am on a Mac?

I believe it is also /etc/hosts