Create or Change a WordPress Admin user with MySQL and phpMyAdmin

Easily add a new WordPress Admin user or change a user password via phpMyAdmin in MySQL

Login to your webhost.

Open phpMyAdmin.

Expand the database for the website.

To create a new WordPress Admin user you must edit two tables.

Open wp_users table

Click Insert at the top of the page and enter this info in these fields:

ID: Use a number not already used as a user ID [remember this number – you will use it again]

user_login: Insert a user name
user_pass: Insert a password

user_pass: Select MD5 in the Function drop down menu

user_nicename: Insert a full name or nickname

user_email: Insert the user’s email

user_url: Leave blank, or insert your website address

user_registered: Leave blank or select any date and time

user_activation_key: Leave blank

user_status: Insert the number 0 (zero)

display_name: Insert the user’s full name or display name

Open wp_usermeta table

unmeta_id: Leave blank
user_id: Insert the user ID you used above in the wp_users table

meta_key: Insert:
wp_capabilities
meta_value: Insert this:
a:1:{s:13:"administrator";s:1:"1";}

Once you’ve entered these fields you must enter the info below in the next section BEFORE you click Go.

unmeta_id: Leave blank
user_id: Insert the user ID you used above in the wp_users table

meta_key: Insert:
wp_user_level
meta_value: Insert: 10

After entering this information click the Go button to complete creating the new admin user.


How to change a WordPress Admin User Password with MySQL and phpMyAdmin

If you cannot use the login page Password Reset option (e.g. if email is not working for the site, or if you don’t know the user email adress), you can change an admin (or any) user password using MySQL and phpMyAdmin.

Login to your webhost.

Open phpMyAdmin.

Expand the database for the website.

Open wp_users table

Select Edit for the user record you want to change.

user_pass: Insert a password
user_pass: Select MD5 in the Function drop down menu

After entering this information click the Go button to complete the password change.


See also:

Similar Posts