👋🏼Welcome to my WP-Host blog where I am excited to share my knowledge and expertise on WordPress hosting and website construction tutorials with you. Let’s connect and learn from each other! You can reach me at info@yrshare.com.

(如果你会中文,可以点击微信图标与我联系。)

扫一扫加我

注:因个人英文水平有限,所以暂时只能为懂中文的朋友提供wordpress建站服务

微信:18200592859 或 yrwordpress

通过数据库添加wordpress管理员帐号(超实用)

通过数据库添加wordpress管理员帐号(超实用)。有人可能会遇到wordpress网站密码忘记的情况,甚至还可能遇到网站用户被误删除的情况,这就比较麻烦了,因为没办法找回密码,没办法登陆,wordpress会提示你没有该用户。这种情况下我们可以通过数据库来找回密码。

【WP-Host/悦然wordpress建站】
Creating a WordPress administrator account through the database (extremely practical)-WP-Host

Keep sharing wordpress tutorials. One of my customers encountered a strange problem before. After he used a wordpress content reset plugin, the website users were cleared.

In general, if a website forgets a password, it can be retrieved through the database. 【WP-Host/悦然wordpress建站】 has previously shared a corresponding tutorial, which everyone can refer to in the above article. However, this user’s situation is quite unique as their WordPress site username has been completely erased. Therefore, the password recovery method mentioned above is not applicable. Next, I will share with you the real solution – adding a WordPress administrator account through the d

Step 1: Log in to the database to add users

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

Log in to the website database and find the field storing the user name of the WordPress website. The default value is [wp_user]. If you modify it, it may be a different name, as shown in the above figure. My demo site has been modified. Then click [Insert].

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

Enter the account information in the pop-up window, as shown in the figure above, here you need to remember the first line of ID, which will be used later, and then user_pass is the MD password, you can directly use the MD5 password I provided [5d41402abc4b2a76b9719d911017c592] to decrypt it is
: [hello]. Finally, click Execute and continue to the next step. Although we have added a user at this time, this user does not have any permissions. He can log in to wordpress, but he cannot see the management background.

Step 2: Add user permissions

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

Next, we find the [wp_usermeta] field. Because my demo site has modified the prefix of the database table, the field is [wpxx_usermeta]. Click on this field, and then click [Insert] to fill in the information in the above picture. Note here that the second line [user_id] in the above figure needs to be the same as the id filled in the previous step. Then fill in [wpxx_capabilities] in [meta_key], fill in [a:1:{s:13:”administrator”;b:1;}] in [meta_value], and then execute it until the next step.

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

Also in the [wp_usermeta] field, we click Insert again, fill in [user_id] as [3], [meta_key] as [wpxx_user_level], and [meta_value] fill in [10], and finally click Execute and continue to the next step.

As for the addition of the administrator account, we have completed the addition of the administrator account. Next, we need to log in to the wordpress background with the account we added, and then re-edit the user name, modify the information and password, and then save it.

Summarize

The above is the WordPress tutorial that we shared with you today. Although there may not be many users who encounter this type of situation, it can be very troublesome once encountered. The existing tutorials online are introduced from a programmer’s perspective, which may be difficult for many basic WordPress site users to understand. I hope that the version I’ve shared can be helpful to you.

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

继续分享wordpress建站教程。之前悦然wordpress建站的一个客户遇到了比较奇怪的问题,他使用了一款wordpress内容重置插件后导致网站用户被清空了。

https://yrshare.com/zh/use-the-database-to-reset-the-website-password/

一般情况下网站忘记密码后是可以通过数据库找回来的,悦然wordpress建站之前有分享过对应的教程,大家可以查看上面这篇文章。但是该用户的问题比较特殊,它的wordpress站点用户名被完全清空了,所以上面的恢重置密码的方法并不适用。接下来悦然wordpress建站给大家分享真正的解决方法——通过数据库添加wordpress管理员帐号。

步骤一:登陆数据库添加用户

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

登陆网站数据库,找到存储wordpress网站用户名的字段,默认为【wp_user】,如果修改的而可能是其它名称,如上图所有,我的这个演示站就是修改过的。然后点【插入】。

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

在弹出的窗口中输入帐号信息,如上图所示,这里需要记住第一行ID,后面还会用到,然后user_pass是MD密码,大家可以直接使用我提供的MD5密码【5d41402abc4b2a76b9719d911017c592】解密过来是:【hello】。最后点执行,一直下一步即可。此时我们虽然添加了用户,但是这个用户是没用任何权限的,可以登陆wordpress,但是看不到管理后台。

步骤二:添加用户权限

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

接下来我们找到【wp_usermeta】字段,我的演示站因为是修改过数据库表前缀的,所以字段为【wpxx_usermeta】,点开这个字段,然后点【插入】,填写上图中的信息。这里注意一下上图中的第二行user_id需要与上一步填写的id一样。然后【meta_key】填写【wpxx_capabilities】,【meta_value】填写【a:1:{s:13:”administrator”;b:1;}】,然后执行,一直下一步即可。

Creating a WordPress administrator account through the database (extremely practical)-WP-Host

同样在【wp_usermeta】字段,我们再点插入,分别填写【user_id】为【3】,【meta_key】为【wpxx_user_level】,【meta_value】填写【10】,最后点执行,一直下一步即可。

至于我们就完成了管理员帐号的添加,接下来我们还需用我们添加的帐号登陆wordpress建站后台,然后重新编辑一下用户名,修改信息和密码,然后保存。

总结

以上就是今天给大家分享的wordpress教程,可能遇到此类情况的用户不多,但一旦遇到即非常头疼,网上现有的教程都是以程序员的视角来介绍的,很多基础wordpress建站用户可能看不懂,希望我分享的这个版本能够帮到你

WordPress Hosting / 悦然wordpress建站

WordPress Hosting / 悦然wordpress建站

【WordPress Hosting / 悦然wordpress建站】我是来自中国的wordpress爱好,喜欢与世界各地的朋友一起交流学习wordpress建站和维护相关知识。