How to Create an Admin Account in WordPress via MySQL

  1. Log into your cPanel interface of hosting provider
  2. From the main cPanel screen, go to Databases category and click on  phpMyAdmin., this will take to PHP myadmin url
  3. Now in the left hand sidebar and select your database of wordpress website and click on database.
  4. After the database information loads, you will need to find the tab named SQL and click on it. screen shot
     Wordpress Login here  i616613_wp20 my database name and you need to click on Database and then click on SQL to run the query
  5.  SQL editor  will be opned where you will enter  code that will create a new admin account for you.

    Below is the code to create a new admin account named adminaccount with the password pasword#123.

    INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
    VALUES (‘adminaccount’, MD5(‘pasword#123’), ‘firstname lastname’, ‘youremail@domain.com’, ‘0’);

    INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
    VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_capabilities’, ‘a:1:{s:13:”administrator”;s:1:”1″;}’);

    INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
    VALUES (NULL, (Select max(id) FROM wp_users), ‘wp_user_level’, ’10’);

  6. click the Go button to insert new admin account in database.

Now go to wordpress admin login screen and login with new username and password that is
Username – adminaccount

Password – pasword#123

 

Please let us know in case of any issue

Updated: August 11, 2018 — 2:41 AM

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 7 =


Tech Contents © 2016
Inline
Inline