Changing MySQL hostname

Hi. I run a few sites on my account. When I created a new database and installed wordpress for a new site, I accidentally chose a MySQL hostname for an older site insteading of creating a new one.

I have been using the new site for a while and would like to change its MySQL hostname. How would I do this without losing any data from the wordpress database?

On Dreamhost, you can have numerous hostnames (they are interchangeable) that you can use to access a database, so this is particularly easy. :slight_smile:

Just point your browser to Control Panel -> Goodies -> Manage MySQL and click the “green plus-sign” indicated link for “Add New Hostname” under the appropriate server (or your only server, if you are only using one). Enter the new hostname on the resulting page, and submit the form by clicking the “create this mysql Hostname” submit button, wait for the DNS to update for the new hostname (you can tell it is “ready” when you can browse to it), and you are good to go.

You can then modify your software installation to refer to the new hostname.