Changing the vCenter Database username and password isn’t a difficult task, although it very quickly becomes a bit convoluded. This is because you can’t just make the change in one place. It is made in several.
To start and a very important step is to make the selected user a DBO on the vCenter database, before anything else is changed, this should be the first step. Anyway, lets get started.
Let’s Stop the vCenter Service, it would probably crash at some point during this process anyway, so we might as well just stop it.
Secondly we need to change the username vCenter uses. Most would probably think that there is some sort of Configuration Utility that we could simply run that would make the change. Wrong! We have to jump in to the registry to change it. So using “regedit”, navigate to “HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VirtualCenter\DB” if you are using vCenter 5.
Now we change entry 2 to reflect what our new user should be.
Awesome! Great! We’re done right? Wrong!
Next we need to change the password. Again, since we just changed the username in the registry, one might think the password is also changed there. Nope, sorry. For this we need to use an ELEVATED CMD prompt navigate to the folder that contains our vCenter install. If my capitalization was not an ample hint, it must be an elevated command prompt.
The default install location for vcenter is C:\Program Files\VMware\Infrastructure\VirtualCenter Server\, and the command we need to run is “vpxd -p”. If you install location is different, obviously use yours 🙂
This command will ask you for the DB password. After you supply it, it will then put your password into the registry under the username you changed earlier, although it will be hashed and probably salted.
Now, at this point, if your last user and your new user were both Active Directory/Windows users, you should hopefully be able to start the vCenter service and everything will work again! However, if you are changing sql authentication users in any way (i.e. you last user was a sql auth user, or your new one is, or both) you need to modify your DSN for vCenter.
You can change the DSN by launching ODBC, located in Start-Administrative Tools- Data Source (ODBC). On the System DSN tab you shoud be able to find your vCenter DSN listed that you can modify.
When modifying you should be able to just change the info on the second page.
This is where you would change your user, if it is going to be an Active Directory/Windows user you select the top radial button, otherwise select SQL auth and supply the username and password. This should be the only piece of info that needs to be changed.
Now you should be able to restart your vCenter Service.
NoobTip: If you do all these steps, and you are still unable to start the vCenter Service…Recreate the DSN. Yep, Delete it and Recreate it. It takes only a minute or two, but any time I have had a problem with this stuff, ReCreating the DSN has resovled it. Just note, you need to recreate with the same name and driver name it had. This is listed on the DSN page, or in the registry if you have already deleted the DSN :).
For other refereneces, like registry locations in other versions and Windows sytems check these links