Hi Guys!
Hope you are doing well. Also hope all my Muslim friends enjoyed the EID vacation with friends and family.
Today I am going to show you how to add an admin user for a WordPress site via phpMyAdmin. Sometimes you may need to add an admin user but you dont have the admin credentials. Though you may have the cPanel access. In this situation you can go through the below steps and get an admin user. There is three simple steps to make an admin user.
Step 1 : Open your MySQL Database
- Login to your cPanel
- Go to Database section
- Click on phpMyAdmin icon
- Select your WordPress database from the list of databases in phpMyAdmin
Step 2 : Insert a new record in “wp_users” table
Go to “wp_users” table and click on the “insert” icon
You need to fill in the following fields to insert a new user record
- ID – Leave it blank, it will automatically assign the correct value
- user_login – Insert your desire unique username
- user_pass – Insert your desire password by selecting the MD5 from function list
- user_email – Insert your desire email address for the user
- user_registered – Select data/time for the user registration data/time
- user_status – Set this value 0
You can leave all other fields blank for now on. Click on “GO” button and you should see the success message.
Now you can browse the table to make sure the data has been inserted. Also you need the ID value for the next step.
Step 3 : Insert user meta value on “wp_usermeta” table
Go to “wp_usermeta” table and click on the “insert” icon
Now you need to fill the following field to insert a new record,
- umeta_id – Leave it blank, it will automatically assign the correct value
- user_id – Insert the ID value getting from the previous step when you insert data in the “wp_users” table. In our case its 2
- meta_key – Insert wp_capabilities
- meta_value – Insert a:1:{s:13:”administrator”;s:1:”1″;}
Click on “GO” button and Bingo! You can now login with your given username and password to your WordPress dashboard with an Admin privilege.
N.B. WordPress is not using MD5 hashing for store user password now a days, but it has backward compatibilities so that it still support MD5 hash. When you logged in with your password, if WordPress found that your password is stored with MD5 hash then it convert that password with new hashing technology and store that new hash value in wp_users table.