从数据库添加一个wordpress的admin用户
主要是通过直接添加一个用户来实现。
有2个表:wp-users
和wp-usermeta
。
1、向wp_users
表添加一个用户:Fill in the following fields.
- ID is any number you choose
- user_login is the username for accessing the WordPress Dashboard.
- user_pass is the password for the user. Make sure to select MD5 in the functions menu (这里的意思是,可以直接填写明文密码,选择左侧函数页选项里的MD5,就自动加密了)
- user_nicename is the nickname for the user
- user_email is the email address you want to associate with this user
- user_registered is the date and time for when this user is registered
- user_status should be set to
0
- display_name is the name that will be displayed for this user on your site
2、 向wp_usermeta
表添加一个记录:
- user_id is the ID you entered in the previous step
- meta_key should be the phrase
wp_capabilities
- meta_value should be
a:1:{s:13:"administrator";s:1:"1";}