• Home
  • Categories
    • WordPress Troubleshooting
    • WordPress Tips and Tricks
    • SSH (Secure Shell)
    • WordPress Insights
    • WordPress Common Facts
    • Securing WordPress
  • Series Tutorials
    • Advanced WordPress Topic
  • Privacy Policy
  • Terms of Use
  • Contact Me
  • About WP Tuts Hub
Home  /  WordPress Tips and Tricks • WordPress Troubleshooting  /  How to Create New WordPress Administrator via MySQL
WordPress Tips and Tricks
July 30, 2016

How to Create New WordPress Administrator via MySQL

zubaer WordPress Administrator, WordPress Tips, WordPress Tricks Leave a Comment
Share on Facebook Share on Twitter Share on Pinterest Share on StumbleUpon Share on Reddit Share on LinkedIn Share on tumblr
Email this article!

Sometimes, you may feel the necessity of creating a new administrator account or an admin user via MySQL database if you loose access to the admin user or for some other reasons. Here I will describe a step by step method to create an admin user directly via MySQL from cPanel.

Step by Step Method to Create New WordPress Administrator via MySQL:

Step 1: Access Your MySQL Database

  • Log into your cPanel/Control panel
  • Go to “Database” section
  • Click on PHPMyAdmin icon

Step 2: Go to the wp_users table

Important: In my case the database table prefix is “wp_“. So, I am telling “wp_users“. If you have a different table prefix replace “wp_”  with that in all cases below.

  • Select your WordPress database from the list of databases in PhpMyAdmin
  • Go to the wp_users table and click on the “insert” link

Step 3: Insert a New Record in the Users Table

You will need to fill in the following fields to insert a new user record:

  • ID – Keep the value of this field empty (it will automatically assign the correct value for it)
  • user_login – insert the username you want to use
  • user_pass – add a password for the account. Select MD5 in the functions menu (Refer to the screenshot below).
  • user_nicename – leave this field empty for now
  • user_email – add the email address you want to use for this account.
  • user_url – leave this field empty for now
  • user_registered – select the date/time for when this user is registered.
  • user_status – set this to 0.
  • display_name – leave this field empty for now
  • Click on the Go Button (you should see a success message)

create new administrator account using mysql

You can go back to the wp_users table and browser the entries to verify that the user record has been inserted correctly.

Step 4: Insert User Meta Values

  • This is the final step where we will assign some user meta values to the user account we just created.
  • Go to the “wp_usermeta” table and click on the “insert” link:
  • Use the following values and click the “Go” button to insert the usermeta data
  • umeta_id – Leave it blank (it will be generated for you)
  • user_id – This is the ID of the user we created in the previous step. In my case, it is 10.
  • meta_key – Use: wp_capabilities (This is very important step: You must change it according to table_prefix. i.e, if your table_prefix is “bp_” instead “wp_” then you must use “bp_capabilities” instead of “wp_capabilities”.)
  • meta_value – Use the following value for this field:
a:1:{s:13:"administrator";s:1:"1";}

create new administrator account using mysql step 4

Almost done! You can now log into your WP site using this newly created WP User account. You can use this account to change the password of your other user accounts or delete them (if you want to).

Final Step (Important):

Though you now have an active administrator account, but you must update your nicename or just click on “Update Profile” from WordPress Backend. It gives you some additional permissions. Otherwise, you may face some errors. I hope you have successfully created a new administrator account or admin user. But if you are facing any problem please email me at zubaer[at]wordpressinsights[dot]com.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Previous Article How to Fix HTTP Error in WordPress (Different Possible Ways)
Next Article Frequently Used SSH (Secure Shell) Commands for a Web Developer

About Author

zubaer

Hi, My name is Zubaer and I am a Web Devloper. Besides, I am Hybrid Mobile App Developer. My fields of proficiency are WordPress, Laravel, HTML, CSS, JavaScript, AngularJS and PHP. You can visit www.zubaer.com to know more about me.

Related Posts

  • WP Cron - All scheduled cron jobs

    Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 2

  • Secure WordPress site from hacking, DDoS and Brute force attack

    How to Secure WordPress Site From Hacking, DDoS and Brute Force Attack




Popular Posts

  • Using Cron Job in WordPress - - Schedule Events With WP-Cron
    Using Cron Job in WordPress – Schedule Events With WP-Cron: Part 1 December 20, 2016
  • C Program to Store Multiple Student Records Using Structure and Pointer May 27, 2023
  • SSH Secure Shell Commands
    Frequently Used SSH (Secure Shell) Commands for a Web Developer September 7, 2016
  • Update WordPress site URL via PHPmyadmin
    WordPress Replace Old URL After Domain Change September 27, 2016

Categories

  • Advanced WordPress Topic2
  • C Programming2
  • Computer Programming2
  • Securing WordPress2
  • Series Tutorials2
  • SSH (Secure Shell1
  • WordPress Common Facts1
  • WordPress Insights2
  • WordPress Tips and Tricks4
  • WordPress Troubleshooting3

Calorie Calculator Pro

  • US Units
  • Metric Units
Please enter your age
Please enter your gender
Please enter your height
Please enter your weight (Pounds)
Please select an activity level
Your body fat percentage (optional)
Please enter your First Name
Please enter your Last Name
Please enter your best email address
Please enter your age
Please enter your gender
Please enter your height
Please enter your weight (Kg)
Please select an activity level
Your body fat percentage (optional)
Please enter your First Name
Please enter your Last Name
Please enter your best email address
Please enter your best email address
Problem? Try Another

Archives

  • May 20233
  • July 20171
  • December 20162
  • September 20162
  • July 20162

Tags

File Upload Error HTTP Error Prevent DDoS and Brute Force Attack Schedule Events Secure Shell Securing WordPress SSH SSH Commands Structure and Pointers in C Structures in C Programming Using Cron Job WordPress Administrator WordPress Common Facts WordPress Cron Job WordPress Error WordPress Insights WordPress Tips WordPress Tricks WP-Cron

My Services and Products

  • Hire Me or Contact Me
  • My WordPress Plugins and Themes
  • WeboCoder
  • Privacy Policy
  • Terms of Use
  • About Us

Subscribe

    Your Name (required)

    Your Email (required)

    Random Posts

    • C Program to Store Multiple Student Records Using Structure and Pointer May 27, 2023
    • http error with wordpress file upload
      How to Fix HTTP Error in WordPress (Different Possible Ways) July 25, 2016
    • Update WordPress site URL via PHPmyadmin
      WordPress Replace Old URL After Domain Change September 27, 2016
    © WP Tuts Hub 2023.
     

    Loading Comments...