In my WordPress Course, my students occasionally lock themselves out of their WordPress admin dashboard. Since they are developing themes in public workspaces, they usually do not configure email on these workspaces. Instead, we use phpMyAdmin to reset our passwords manually in the database. phpMyAdmin is a great tool for students because it allows users to access their MySQL database using a GUI. This is intuitive interface displays the SQL queries whenever the user interacts with the database. Students can use this feature to double-check their query syntax when they encounter errors.
Install phpMyAdmin in Cloud 9
- Open your Cloud 9 WordPress workspace
- In the “bash” tab type:
- The server should return the URL and username needed to access the service in your browser:
- Open the URL in your Web browser and log into phpMyAdmin
- Open the c9 database and select the table “wp_users” to display your user account. Note, the password stored here is encrypted, usually with an MD5 hash.
- One really cool thing about phpMyAdmin is that when you perform any action within the site, your SQL query is displayed following the result report at the top of the page. Students new to MySQL can use this tool to interact with the database and understand more about the SQL queries used by the PHP application.
- If you select “Edit” in the user row you need to reset, the data will load in a user-friendly form. Identify the “user_pass” fields. Here you can select MD5 “function” drop-down menu and type your new password in the “value” field. Press “Go” to write your new password in the database.
- You should receive confirmation that your changes were successful. Notice you can see the UPDATE query as well as the current SELECT statement.
Now that we’ve reset our password, we should be able to log into our WordPress dashboard successfully. If you’re using XAMPP, phpMyAdmin is included with that installation. To access it, just type http://localhost/phpmyadmin/ in your browser. phpMyAdmin is a great tool to use if you’re unfamiliar with SQL, want to see all the available options, and understand the structure of your WordPress database.