Support » Fixing WordPress » how can I change the password for the database?

  • I need to change the password that is for the WordPress MySQL database. I have changed the password in the wp-config.php file, I have changed my user password. I have changed the password for my plesk control panel, etc. Some previous threads have said to change the wp-config.php but that did not change my database password, the password used to access the database from .asp for example. My web host tells me that the database password cannot be changed, they say that I must delete/uninstall wordpress and then do a new fresh install. Is that right?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi

    A way I’ve used to change a database password is to log into the web hosting control panel. Delete the database USER (NOT the database!) and recreate that same user, assigning it a different password. Then all you need to change in wp-config.php is the revised password. If for some reason you are unable to delete the existing database user, create a new one with the password you want (a different database user name). Then update wp-config.php with the new user and password.

    When you create the new user, you have to associate that user with the existing database. And you must all assign all database permissions in that database to that new user.

    Thanks for the help. I am not able to delete the ‘problem’ database user. I followed your advice and created a new user with a new password. I was not able to find anyplace in phpMyAdmin to assign database permissions, but I was able to make the new user the primary admin and when I go into phpMyAdmin that is the user that shows up. The problem username is still working though. My web hosting company says that the database is corrupt and that I should export it as sql and import it. Another odd thing is that when I look in the plesk panel for installed applications, I see WordPress listed twice. I think I will try backing everything up and deleting one of the WordPress installations. Also, I installed WP into a subfolder named wordpress. I might try installing it at the main level and not in a subfolder and then importing/recreating the blog/website.

    If you move the WP installation’s location from /wordpress/ to the root level, after you export the database you will want to do a search and replace on the entire SQL dump file. Save a copy of the unmodified dump file before you change anything, in case of any problems.

    Search for and replace it with

    Then search for and look at each occurrence of that to see if it needs to have the URL modified to the new location.

    (You are supposed to use your domain, not, just to be clear.)

    I move databases regularly using this method – it works fine.

    I am more familiar with Cpanel than Plesk. As an FYI, in Cpanel the place I assign permissions to a user is in Cpanel itself, not in PHP My Admin. Most likely its the same in Plesk.

    It sounds like you will be able to get your site back together if you take the steps you described.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how can I change the password for the database?’ is closed to new replies.