Guest User

Untitled

a guest
Jan 23rd, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. -- insert new admin
  2. SET @id = 111; -- change this to some unused id
  3. SET @user = 'username'; -- change this to your username
  4. SET @pwd = 'password'; -- change this to your password
  5. SET @email = 'email@ddress'; -- change this to your email
  6. SET @name = 'Your Name'; -- change this to your name
  7. SET @creationdate = '2018-01-01 00:00:00'; -- set to the date you want
  8.  
  9. INSERT INTO wp_users (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) VALUES (@id, @user, MD5(@pwd), @name, @email, '', @creationdate, '', '0', @name);
  10. INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
  11. INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'wp_user_level', '10');
  12. INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, @id, 'active', '1');
  13.  
  14. -- reset admin password
  15. SET @login = 'script'; -- change this to your username
  16. SET @pwd = 'password'; -- change this to your password
  17. UPDATE wp_users SET user_pass = MD5(@pwd) WHERE wp_users.user_login = @login LIMIT 1;
Add Comment
Please, Sign In to add comment