Sometimes you need to change one piece of data stored in your website's database directly, without going through your website's admin panel. phpMyAdmin, the database tool included with your hosting account, lets you browse a table's rows and edit a value with a few clicks, or run a targeted SQL query if you know exactly which field needs to change.
When You Might Need to Do This
Editing a database table directly is usually a last resort for situations your website's own admin screens can't fix, such as:
- Correcting an admin email address stored in the database when you're locked out of the normal settings page.
- Fixing an order or booking record that's stuck in the wrong status.
- Updating a single setting for a custom-built application that has no admin interface for it.
Back up your database before making any change. phpMyAdmin edits take effect immediately, and there's no undo button. See the ZIPROF guide on backing up a single MySQL database and keep a fresh copy on hand before you continue.
How to Open phpMyAdmin
In cPanel, log in and click phpMyAdmin under the Databases section. In DirectAdmin, log in and click phpMyAdmin under the Extra Features or Databases section, depending on your account's layout. Either way, phpMyAdmin opens as its own tool with the same interface once you're inside it.
How to Edit a Row Using the Browse Tool
- In the left-hand panel, click your database name to expand its list of tables.
- Click the table that holds the data you need to change.
- Click the Browse tab at the top to see the table's rows.
- Find the row you need. For a large table, use the Search tab instead and enter a value you know, such as an email address or an order number, to locate the exact row faster.
- Click the small pencil icon (Edit) next to that row.
- Change the value in the field you need to update, then click Go to save it.
How to Edit a Value Using an SQL Query
If you're comfortable with basic SQL, the SQL tab lets you update a value more precisely, especially useful when you need to change the same field across several rows at once. For example:
UPDATE table_name SET column_name = 'new_value' WHERE id = 123;
Always include a WHERE clause that targets the specific row (usually by its unique ID). Leaving it out updates every row in the table, which is very difficult to reverse without a backup.
After You've Made the Change
Reload your website or log back into the application to confirm the change took effect the way you expected. If something looks wrong, restore the backup you took before you started rather than trying to guess your way back to the original value.
For a refresher on taking that backup first, see How to Back Up a Single MySQL Database.