Easy/safe to change hostname & username for mySQL database?


#1

Can someone reassure me that it’s safe to change the name of a hostname for a mySQL database? Basically what happened is that I created a subdomain (beta.example.com) as a beta site for developing a new Wordpress website. This was my first time working with a database, since my main site did not use a database and wasn’t created with Wordpress, so it was all from scratch. I have successfully migrated the beta site to the main site, and it’s working. BUT…while setting up my dev site, I named the hostname with a beta prefix, but now that it’s not beta anymore, I’d really like it to be more of a generic name (I’ve now learned my lesson for future!) So this is more of a “housekeeping” question for making my own workflow more organized.

  1. How do I go about safely changing the hostname - is it through phpMyAdmin? Along the same lines, the database still says it’s pointing to the beta.example.com (Under Databases>description). Shouldn’t it now be my main site? Everything seems to be working just fine on the main site, so I’m a little confused.

  2. I also was wondering about Usernames within the mySQL databases. Again, when I was setting up the beta, I picked a username that was not ideal. Can I safely create a new username with full account access and have that new user be the main adminstrator, then delete the “not ideal” one?

Would there be a preferred order for me to make these name changes?

I don’t have a great big picture understanding of how all these things are interlinked, and I’d hate to cause problems/errors just from changing names. Thanks in advance!!


#2
  1. All the hostnames that are listed at https://panel.dreamhost.com/index.cgi?tree=goodies.mysql& point to the same database server. In other words they are interchangeable. If you have a hostname entry for example.com already feel free to edit wp-config.php and change the instance beta.example.com to simply example.com. If you have to add a hostname entry for example.com give it a little time before you edit wp-config to match.

  2. It should work that way. But if you make that change I would add new, edit wp-config to use new, give it a day or two then delete the old username if you haven’t run into problems.