All but the simplest of websites use databases. Everything that happens on your WordPress site β regardless of its complexity β is recorded to one. However, you may sometimes need to access and interact with your database content β and thatβs often difficult without the right knowledge and tools.
Thatβs where phpMyAdmin (and other tools like it) come in. This user-friendly software enables you to interact with your databases easily. In this article, weβll talk about what the software does, how to configure it, and some of the tasks it can help you tackle.
Letβs jump in!
An Introduction to phpMyAdmin
phpMyAdmin is an open-source tool built on PHP that enables you to administer MySQL and MariaDB databases online. To use it, youβll need to install the software on a server running either Windows or one of the several Linux distros it supports.
The software enables you to manage as many databases as you want. You can edit tables and values, create and delete databases, or even import and export them. The application itself is easy for beginners to pick up, but it offers enough depth that it can take a while for you to master everything it offers.
Key Features:
- Administer your databases using an open-source web application.
- Set up phpMyAdmin on both Windows and Linux-based servers.
- Modify any value within your databases.
- Execute Structured Query Language (SQL) queries to interact with your databases more efficiently.
- Create and remove databases at will.
- Export and import databases with a few clicks.
Most WordPress hosts come with phpMyAdmin bundled into their cPanel software. However, some managed hosting services such as Flywheel use different tools, so your mileage may vary.Β If youβre running your own server, you can set up phpMyAdmin on your own, which weβll discuss in the next section.
How to Set Up phpMyAdmin (And Configure Its Settings)
First off, if you want to set up phpMyAdmin on your own server, the process isnβt that complicated for those with the expertise. If youβre using Linux, you can do so using a simpleΒ apt-getΒ command, whereas Windows Server users can use the Composer tool for an easy setup.
However, youβll usually find access to the latest version of phpMyAdmin within your hosting account. To access it, navigate to your management dashboard (usually cPanel or Plesk), log in using your credentials, then look for theΒ Databases sectionΒ β there should be aΒ phpMyAdminΒ icon inside:
Clicking on it will launch the application. While you can start working on your databases right away, you should configuring some settings first. For example, you can change the default language and font size from the main screen, underΒ Appearance settings:
You can also change phpMyAdminβs theme if you want to. Depending on your host, you should only have access to a couple of themes by default, although others are available.Β Changing themes wonβt affect the softwareβs functionality, of course, but it can make for a better experience if you start using it often.
4 Tasks phpMyAdmin Can Help You Accomplish
Before we jump into the tutorials, keep in mind that weβre going to be focusing on WordPress-related tasks. We wonβt be talking about SQL queries, for example, which are sophisticated enough to require more thorough documentation.
Thereβs far more you can accomplish with phpMyAdmin than we can cover in one article. If youβre interested in learning further, youβll want to check out the official documentation, which includes everything you might want to know.
Finally, if you are going to poke around under WordPressβ hood, remember to carry out a full site backup in case something goes wrong.
1. Checking the Status of Your WordPress Database
First off, phpMyAdmin enables you to check the status of your MySQL or MariaDB server. To do this, jump to theΒ StatusΒ tab in phpMyAdminΒ withoutΒ selecting a specific database:
Inside, youβll find a summary of all the traffic your server has sent and received while itβs been running. Thereβs also a running tally of concurrent connections, and even failed attempts. If youβre using a shared hosting plan, chances are your numbers wonβt make much sense. This is because youβre not the only person using the MySQL server. However, if youβre running a private server, these figures should be much more accurate, and they can help you determine how much bandwidth youβre consuming.
In most cases, if your database is inaccessible, you wonβt be able to use phpMyAdmin at all since the tool wonβt be able to establish a connection. This may also lead to WordPress displaying an error saying it canβt connect to your database, which you can fix following this tutorial.
2. Accessing and Editing Your WordPress Databases
Accessing your WordPress databases is simple β phpMyAdmin displays all of your existing databases on its sidebar, and if youβre only running one site, there should be a single option. In our example, we have several of them, but you can identify the WordPress databases as they often includeΒ wpΒ in their name:
By default, WordPress uses theΒ wpΒ prefix for all its databases. However, you can change the setting (as we did) to make it more difficult for attackers to try and access yours. Either way, once youβve identified the database you want to edit, click on it. Youβll see a list of tables including easy-to-recognize names, such as comments, users, and posts:
For example, if you wanted to edit one of your posts within phpMyAdmin, youβd just need to click on theΒ wpca_postsΒ table name (not theΒ BrowseΒ button). Once youβre in, your posts should show up in order using their IDs:
If you want to delete a particular post, you just need to identify it either through its ID or theΒ post_titleΒ field, then click on theΒ DeleteΒ button for that row. Alternatively, if you want to edit a post, click theΒ EditΒ button on its corresponding row:
Inside, you can edit every value associated with that post, including its title, content, the date it was last modified, and more. The names for each value are simple to understand, so you should have no problems identifying each of them:
Once youβve made your changes, scroll down to the bottom of the screen and click theΒ GoΒ button to save them. This will also return you to theΒ wpca_postsΒ table, where you can start anew with a different post. The process for editing values is the same regardless of which table youβre working with β the only things that change are their corresponding values. Given this, you should be extremely careful about any changes you make at a database level and while editing fields youβre not familiar with.
3. Adding (And Removing) WordPress Databases
Deleting databases is the more straightforward process of these two, so itβs a good starting point. To delete a database, go to the phpMyAdmin main screen and look for theΒ DatabasesΒ tab at the top:
Inside, youβll find a list of all the databases you have access to.Β IfΒ you have the right permissions, youβll also see the option to select those databases and βdropβ them (which is database speak for deletion):
Moving on, any phpMyAdmin user can create new databases. If youβre installing WordPress manually, youβll need to create a blank database for the process to work. To do so, return to theΒ DatabasesΒ tab and look for theΒ Create Databases optionΒ at the top of the screen:
You can chooseΒ anyΒ name you want for your database β just make sure itβs one you can identify later on. Click theΒ CreateΒ button when youβre ready, and phpMyAdmin will automatically send you to a screen where you can add tables to your database. Leave it empty for now β instead, go toΒ PrivilegesΒ >Β Add user account,Β and click on it:
Now, choose a secure username and password for your WordPress admin account, then typeΒ localhostΒ within theΒ Host nameΒ field:
Then scroll down to theΒ Database for user accountΒ section and tick theΒ Grant all privileges on X database option. βXβΒ in this case should be the name of your database. Click on Go when finished, and your admin user will be ready. Now you can execute the WordPress installer on your server. The installer will ask you for the name of your database, its host, and your account info:
At this point, you can go through the rest of the WordPress installation, and your website will be ready to go!
4. Importing and Exporting WordPress Databases
phpMyAdmin also enables you to import and export existing databases. This can come in handy if you want to migrate a WordPress website manually, since you have to copy both your files (using an FTP client, for example) and its database. To export a database, access it from the sidebar on phpMyAdminβs main screen, then look for theΒ ExportΒ tab in the main menu:
Inside, youβll see the option to do either aΒ QuickΒ or aΒ CustomΒ export. TheΒ QuickΒ setting automatically includes all of your databaseβs tables. Choose this option, and theΒ SQLΒ format from the drop-down underneath, then click on Go:
This will automatically download an SQL file containing your databaseβs info to your computer. If you want to import it onto a different server, just access phpMyAdmin there and look for theΒ ImportΒ tab:
There, youβll find the option to upload an SQL file to your server. Simply locate the downloaded file and click on theΒ GoΒ button at the bottom of the screen. phpMyAdmin will upload the file and create an exact copy of that database on your server.
Conclusion
In a nutshell, most WordPress users donβt interact with their databases directly. While the platform enables you to tackle most of your day-to-day tasks using the dashboard, it doesnβt hurt to know how to tweak your database manually. For example, if you get locked out of your site, and you canβt reset your password, thatβs something you can fix through a tool such asΒ phpMyAdmin in a few minutes.
In this post, weβve presented four different tasks you can carry out with phpMyAdmin. Letβs recap them quickly:
- Check the status of your WordPress database.
- Access and edit your databases.
- Add and remove WordPress databases (depending on your permissions).
- Import and export databases to a different server.
Do you have any questions about how to use phpMyAdmin? Letβs talk about them in the comments section below!
Article thumbnail image by apatpoh / shutterstock.com.
Very informative blog post. Thanks for sharing. I think it is crucial for a WordPress developer to be able to access the database and phpMyAdmin makes it easy. I just used it the other evening to solve an issue on a development site. Definitely a time saver.
No problem Monique. Happy to help π
I highly suggest learning PHP MyAdmin if you develop in WordPress. I would compare it to getting a flat tire in the middle of nowhere.
Learn at least the basics and you’ll save a lot of trouble.
It’s a valuable skill!
So very true. Thanks for the comment π
Thanks John, for information about using Phpmyadmin. We always fear touching database that we will break something. Very handy if we forget the password.
No problem Rahul. π
I often use phpMyAdmin to change my password if I forget. This is very helpful to maximize the features contained in cPanel Hosting.
Thanks for sharing
No problem. Glad you found it useful π
Thanks John, Very informative and useful post.
Also a great reminder of what we can do. π
Thanks Liz. Very true.