Lost your admin password? Need in to the WP admin but client hasn’t given you access? If you can access the database directly–easiest using a tool like PHPmyAdmin–you can give yourself whatever access you need. ((Big hugs and kisses out to DNA Web Agency for this uber-helpful information lifted for this tutorial.))
Locate the right database–if you have FTP, looking at the wp-config.php file at the root of your WP installation is the fastest route. Otherwise, if you have multiple WP installs, check out the options table to match urls and make sure you’re looking in the right database.
In your wp_users table, you insert a new record:
- user_login –username to access WordPress
- user_pass – password – be certain to select MD5 from the phpMyAdmin Function dropdown menu; it’s stored encrypted)
- user_nicename – how you’d like to refer to yourself, not login
- user_email – email for this user
- user_url – optional
- user_registered – just select a date
- user_activation_key – leave this blank
- user_status – leave this set to 0
- display_name – what displays, can be same as nicename
Note the user ID, as you’ll need it for the next steps.
To give yourself access permissions, head on over to insert a record into the wp_usersmeta table.
- umeta_id – automatically generated
- user_id – ID of the user you just created
- meta_key – wp_capabilities
- meta_value copy and paste this:
[code]a:1:{s:13:”administrator”;b:1;}[/code]
Insert another row, with this information:
- umeta_id – automatically generated
- user_id – use the ID you created
- meta_key – insert wp_user_level
- meta_value – insert 10
Save your work and go log in!