admin管理员组文章数量:1426224
After database problems on my provider side, I had to reset my admin user password. But then this user was not an admin anymore. In PhpMyAdmin I see that it has a user_status value of 0. How can I make this user an amin in WP dashboard ?
After database problems on my provider side, I had to reset my admin user password. But then this user was not an admin anymore. In PhpMyAdmin I see that it has a user_status value of 0. How can I make this user an amin in WP dashboard ?
Share Improve this question edited Sep 7, 2012 at 18:14 Ben HartLenn 2,43518 silver badges19 bronze badges asked Sep 7, 2012 at 12:27 drake035drake035 1,2177 gold badges34 silver badges57 bronze badges 5- This is a hosting issue, not a WordPress Issue. – Eric Holmes Commented Sep 7, 2012 at 13:02
- I'm sorry but I sincerely don't understand your comment. – drake035 Commented Sep 7, 2012 at 13:28
- @drake035 His comment means that this has nothing to do with WordPress and should not be asked on this website. This question should be moved to another of the stackexchange sites, where it can be answered. We know WordPress around here, we have no special knowledge of PHPMyAdmin or MySQL or general hosting questions. – Otto Commented Sep 7, 2012 at 14:50
- 3 I think the question may have been worded a little off but I would say it's definitely a Wordpress-specific question as it's about the organization of the Wordpress user tables. – hereswhatidid Commented Sep 7, 2012 at 17:42
- 6 How WordPress roles are stored in the database is very WordPress specific. I don’t see how anyone could give an answer without WordPress knowledge. – fuxia ♦ Commented Sep 8, 2012 at 3:20
2 Answers
Reset to default 23You actually want to look in the wp_usermeta table. Once in there, look for the entry that has 'wp_user_level
' in it's 'meta_key' column and has the matching 'user_id' that you would like to update. Then change that 'meta_value' to 9 or 10.
It is also required to update the 'wp_capabilities
' meta_key value to 'a:1:{s:13:"administrator";s:1:"1";}
'
Link to current documentation:
http://codex.wordpress/Roles_and_Capabilities#User_Levels
Get access with phpMyAdmin to your WordPress database.
In phpMyAdmin, click on the tab "SQL" in the top tab bar.
Enter this SQL command (with your actual WordPress username instead of
your_username
) and click "Go" to execute it:SELECT meta_value FROM wp_usermeta WHERE meta_key = "wp_user_level" AND user_id = ( SELECT user_id FROM wp_usermeta WHERE meta_key = "nickname" AND meta_value = "your_username" )
You will see a single-cell table with a
meta_value
column. Double-click that cell and change its value to10
.Again click the SQL tab, enter this SQL command (with your username instead of
username
) and click "Go" to execute it:SELECT meta_value FROM wp_usermeta WHERE meta_key = "wp_capabilities" AND user_id = ( SELECT user_id FROM wp_usermeta WHERE meta_key = "nickname" AND meta_value = "your_username" )
Again you will see a single-cell table with a meta_value column. Double-click that cell and change its value to
a:1:{s:13:"administrator";b:1;}
.
(There is a more automated way with SQL UPDATE
commands instead of the above. Welcome to add it. However, sometimes only executing SELECT
s and doing the updates manually will feel safer … no strict need for a database backup etc..)
本文标签: Making someone a WordPress administrator using PhpMyAdmin
版权声明:本文标题:Making someone a WordPress administrator using PhpMyAdmin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745371838a2655765.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论