最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

query - My SQL function to change user_name

programmeradmin1浏览0评论

My wordPress database was hacked and all users_names were changed to the same thing. I'd like to write a mySql query to replace all usernames that = "x" to the user_nicename. I'm unsure how to do this - any suggestions?

My wordPress database was hacked and all users_names were changed to the same thing. I'd like to write a mySql query to replace all usernames that = "x" to the user_nicename. I'm unsure how to do this - any suggestions?

Share Improve this question asked Nov 4, 2015 at 19:14 ckgckg 111 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 2

This should be working:

Be sure that your DB prefix is "wp_"

Update wp_users set wp_users.user_login=wp_users.user_nicename where wp_users.user_login="x" 

To update the Nickname use:

UPDATE wp_users SET user_nicename = 'new_nick_name' WHERE user_nicename = 'x';
发布评论

评论列表(0)

  1. 暂无评论