Getting password from CPANEL using phpmyadmin

DextrousDave picture DextrousDave · Jun 6, 2013 · Viewed 28.3k times · Source

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.

Answer

Skarlinski picture Skarlinski · Jun 6, 2013

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.