MySQL 使用 phpmyadmin 从 CPANEL 获取密码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16959935/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting password from CPANEL using phpmyadmin
提问by DextrousDave
Good Day
再会
I am a front-end developer, and I know little from MySQL and databases.
我是一名前端开发人员,对 MySQL 和数据库知之甚少。
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.
我在 CPanel 中有一个 Wordpress MySQL 数据库。现在我忘记了我的密码,并且在 phpmyadmin 中看到的我的用户密码是散列/加密的。
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 thispost on Stack
在 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.
停止 MySQL 进程。
使用 --skip-grant-tables 选项启动 MySQL 进程。
使用 -u root 选项启动 MySQL 控制台客户端。
List all the users;
列出所有用户;
SELECT * FROM mysql.user;
Reset password;
重设密码;
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';
But DO NOT FORGETto
但不要忘记,以
Stop the MySQL process
Start the MySQL Process normally (i.e. without the --skip-grant-tables option)
停止 MySQL 进程
正常启动 MySQL 进程(即没有 --skip-grant-tables 选项)
when you are finished. Otherwise, your database's security could be compromised.
当你完成时。否则,您的数据库的安全性可能会受到损害。
回答by Skarlinski
If your website is working you can probably find the mysql user/password
in the config.phpfile in your wordpress filesystem.
如果您的网站正在运行,您可能会config.php在 wordpress 文件系统的文件中找到 mysql 用户/密码。
Otherwise:
除此以外:
Your best option is probably to add a user to the database and give it the needed privileges, to do that:
您最好的选择可能是将用户添加到数据库并为其提供所需的权限,以执行此操作:
- Click MySQL databases.
- Create new user.
- Assign new user to your database.
- Edit
config.phpon your wordpress filesystem and change to the new username.
- 单击 MySQL 数据库。
- 创建新用户。
- 将新用户分配给您的数据库。
config.php在您的 wordpress 文件系统上编辑并更改为新的用户名。
This is sub optimal, but will work.
这是次优的,但会起作用。
回答by Conniption
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.
如果您不知道密码,有一种简单的方法可以让您访问您的 WordPress 用户信息。我假设您正在谈论 WordPress 用户密码检索。您需要具有访问和编辑数据库的权限才能执行此操作。
-Open up phpMyAdmin or however you prefer to access database tables
- 打开 phpMyAdmin 或者您更喜欢访问数据库表
-Select your database
- 选择您的数据库
-Open the table wp_users
- 打开表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.
- 在“user_login”列下,您需要找到要访问的条目。您的用户名应该在行条目之一中。
-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.
- 一旦找到,也会有一个“ user_pass”列。现在需要进行一些解释。如果不破解/暴力强制加密,您将无法检索密码。这些是 MD5 哈希加密密码。我们要做的只是简单地在这里创建一个新密码。您所要做的就是谷歌“MD5 哈希生成器”。我在找到的第一个结果上对此进行了测试,并且奏效了。
-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.
- 一旦你找到一个带有生成器的网站,只需输入你的密码,然后检索给你的哈希值。例如,我输入“密码”,然后收到“5f4dcc3b5aa765d61d8327deb882cf99”现在我们有一个新的加密密码要设置。如果您担心网站会保存您的密码条目或哈希值,只需将密码作为临时修复即可。然后您可以使用它登录并稍后通过WordPress仪表板更改密码。
-Select the row that your username is in. Click Change/Edit then just copy and paste the entire MD5 Hash into the wp_passcolumn.(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.
- 选择您的用户名所在的行。单击更改/编辑,然后将整个 MD5 哈希复制并粘贴到wp_pass列中。(顺便说一下,覆盖旧密码。)保存/执行/执行以确保表被重写. 在这个例子中,我当然会将 '5f4dcc3b5aa765d61d8327deb882cf99' 粘贴到不带引号的列中。
-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)
- 请确保只更改“wp_pass”条目并确保它对应于正确的用户名。(在同一行)
-Now you should be able to login with your new password.('password')
- 现在您应该可以使用新密码登录了。('password')

