Join Morten Rand-Hendriksen for an in-depth discussion in this video Accessing the database through phpMyAdmin, part of WordPress Developer Tips: Managing Users in the Database.
- View Offline
As an administrator of a WordPress site, you can get access to all the information about the registered user accounts directly from the WordPress admin panel. Simply login to the admin panel, navigate to Users and All Users. And from here, you get a list of every single user registered on the site. You can see their gravatars, their user names, their full names, their email addresses, the roles they have been assigned, and also how many posts they've published if they have that capability.
From this user admin panel, you can go and edit any of the users. You can change their name and their information and you can also change the role that they have been assigned. But in some cases, you may need to access the user information directly from the database. This could be to reset a password manually, including your own password, or it could be to remove every trace of a specific user or add a new user, or a multitude of other situations. In all of these situations, you need to gain access directly to the database through a database management tool.
And in most cases, that database management tool will be called phpMyAdmin. Now, how exactly you gain access to phpMyAdmin will change depending on the hosting provider you are using. In most cases, you can go to cPanel or whatever other management tool that hosting provider is using and find a link directly to database management or to phpMyAdmin. But in some cases, you have to go about it another way. If it's not obvious to you how to get access to phpMyAdmin, you can contact your hosting provider and they will tell you how you can get in.
For my example, I'm using a site hosted locally on my computer, running on WAMP. And this process will be exactly the same if you're using Mac and you're running MAMP instead. Now I can access phpMyAdmin directly from my local host domain by simply typing in localhost/phpmyadmin. And this will take me directly to phpMyAdmin. If this is the first time you are logging in, you may have to provide a login information. For WAMP and MAMP, the username password combination is usually either root blank or blank blank.
So you have to try a couple of different operations here if you can't get in right away. Once you gain access to phpMyAdmin, you have to find the database that's powering your WordPress site. And the easiest way to do that is to go and look at all the databases you have set up. It's usually just one or two. Find the one you think is the correct one. Select it and then find the table called wp_options. When you go into the wp_options table, you'll find all the options or settings for your WordPress site. And here, in column number two, you get blogname.
So this is will be name of the blog or the WordPress site you're looking at. So here, you can very quickly verify that what you're looking at is in fact a site you want to work with. Once you're inside phpMyAdmin and you know you're working with the correct database, we're ready to start working with the user tables inside that database.