WordPress.org

Ready to get started?Download WordPress

Forums

how can I change the password for the database? (4 posts)

  1. RCSTP
    Member
    Posted 3 years ago #

    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 http://www.webhostingworld.net 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?

  2. stvwlf
    Member
    Posted 3 years ago #

    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.

  3. RCSTP
    Member
    Posted 3 years ago #

    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.

  4. stvwlf
    Member
    Posted 3 years ago #

    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 mydomain.com/wordpress/ and replace it with mydomain.com/

    Then search for mydomain.com/wordpress 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 mydomain.com, 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.

Topic Closed

This topic has been closed to new replies.

About this Topic