Create an Admin Account in WordPress via MySQL

  1. To start, log into your cPanel interface.
  2. click the phpmyadmin iconFrom the main cPanel screen, find the Databases and click on the icon entitled phpMyAdmin.
  3. Once the first screen appears, look to the left hand sidebar and click on the database select that use.
  4. click on the SQL tabAfter the database information loads, you will need to find the tab named SQL and click on it.
  5. This code you to an SQL editor where you will enter some code that will create a new admin account for you. Below is the code to create a new admin account named newadmin with the password pass123. You may change any of the content in red to fit your needs, but leave all other data as is.
    INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
    VALUES (‘newadmin‘, MD5(‘pass123‘), ‘firstname lastname‘, ‘‘, ‘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 go buttonAfter replacing any data fields you need, click the Go button to perform the insert.
  7. you should see the messsage ‘1 row affected‘ after each of the three SQL statements. This means the insertion ran smoothly. From here, visit your wordpress admin login area as normal and use the new admin login information. You should get to the admin interface without issue.