Pregunta

Good Day

I am a front-end developer, and I know little from MySQL and databases.

I have a Wordpress MySQL database in CPanel. Now I forgot my password, and the password for my user as seen in phpmyadmin is hashed/encrypted.

How do I get the password?

NOTE: I do not have access to the Server since this is a website on a shared hosting account, so doing the following is not possible for me:

See this post on Stack

Stop the MySQL process.

Start the MySQL process with the --skip-grant-tables option.

Start the MySQL console client with the -u root option.

List all the users;

SELECT * FROM mysql.user;

Reset password;

UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';

But DO NOT FORGET to

Stop the MySQL process

Start the MySQL Process normally (i.e. without the --skip-grant-tables option)

when you are finished. Otherwise, your database's security could be compromised.

¿Fue útil?

Solución

If your website is working you can probably find the mysql user/password in the config.php file in your wordpress filesystem.

Otherwise:

Your best option is probably to add a user to the database and give it the needed privileges, to do that:

  1. Click MySQL databases.
  2. Create new user.
  3. Assign new user to your database.
  4. Edit config.php on your wordpress filesystem and change to the new username.

This is sub optimal, but will work.

Otros consejos

There is a simple way for you to gain access to your WordPress user info if you don't know the password. I'm assuming you are talking about a WordPress user password retrieval. You need to have access and edit privileges to your database to do this.

-Open up phpMyAdmin or however you prefer to access database tables

-Select your database

-Open the table wp_users

-Under the column 'user_login' you will need to find which entry you want to access. Your username should be in one of the row entries.

-Once found, there will be a 'user_pass' column as well. Now some explaining needs to happen. You cannot retrieve your password without hacking/brute forcing that encryption. These are MD5 hash encrypted passwords. What we are going to do is just simply create a new password here. All you have to do is Google "MD5 Hash generator". I tested this on the first result I found and it worked.

-Once you find a website with a generator just simply type in your password and then retrieve the hash that's given to you. For example I typed in 'password' and I receive '5f4dcc3b5aa765d61d8327deb882cf99' Now we have a new encrypted password to set. If you are worried about sites saving your password entries or hashes just make up a password as a temporary fix. Then you can just login with that and change the password via the WordPress Dashboard later.

-Select the row that your username is in. Click Change/Edit then just copy and paste the entire MD5 Hash into the wp_pass column.(Overwrite the old password btw.) Save/Go/Execute to make sure the table was re-written. In this example I would be pasting '5f4dcc3b5aa765d61d8327deb882cf99' into the column without quotes of course.

-Please be sure to only change the 'wp_pass' entry and to make sure it's corresponding to the correct username.(On the same row)

-Now you should be able to login with your new password.('password')

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top