A lot of WordPress users find it difficult to manage and access WordPress database. As most of the users are using managed WordPress from their hosting service, it can be difficult for them to access database if they have not created one.
There can be various reasons to access your WordPress database. If you are trying to take a manual backup of your WordPress database, then you will require access to it. If you are trying to create a database user or edit it, then you will have to access WordPress database.
More importantly, as a WordPress user, you should know how to edit and access the database of your website. If you are not sure how you can take manual backups or upload the database to a new host, then you will end up paying a lot of money to a WordPress technician. If you want to do it yourself, then it’s the right WordPress guide for you. Let’s have a look at how you can manage the WordPress database.
Identifying WordPress Database
If you have more than one database created on your server, then how are you going to know which one to edit? This is why you will first have to identify the WordPress database that you are going to access.
To do this, you will have to access the wp-config.php file. To access this file, you will require FTP login details or cPanel login details. You will require cPanel login details in the upcoming steps so it is better to access wp-config.php using cPanel.
All you have to do is to log in to cPanel and you will have to access File Manager.
After accessing File Manager, you will have to open the ‘Public_HTML’ folder. In this folder, all the root files of your WordPress are placed. You can look for the wp-config.php file.
Right-click on the file, and click ‘view’. It will open in a new window and you will have to look for the database name. You will look for the line written as:
define ( ‘DB_Name’, ‘Database_Name’ );
This is the name of the database that you will have to access in the database of your website. The next step is to get all the database information.
Getting WordPress Database Information
Before you go on to access WordPress database and make changes to it, you should also get complete information about the database you are using. As you have already opened a wp-config.php file, you can fetch all the database information from it including the database name, database username, database password, and database host.
Make sure to keep the information safe and you may have to use this information while editing the database or making changes to it.
Accessing using PHPmyadmin
Now, you will have to access WordPress Database. To do so, you will have to log in to your cPanel account and access the PHPmyadmin folder.
You can do so, by clicking the PHPMyAdmin folder under Databases.
After clicking the folder, you will be able to see the complete database information of your website.
Here, you will have to click ‘Databases’. After that, you will be able to view databases already created. After clicking the database you wish to view, you will be able to get a list of complete database tables and information.
You can manage database tables here and make edits including emptying the database or dropping it completely.
Exporting WordPress Database (Backup)
If you need to export or take a manual backup of your WordPress database, then you can do so easily.
All you have to do is to access the database that you are using and scroll down. You will be able to see an option to ‘check all’ database tables. After clicking it, you will have to click the button ‘Export’.
You will see 2 options on the next page. You can choose either one of them and click Go.
It will download an SQL file that contains the complete database of your website. That’s how you will be able to take a manual backup of your website’s database.
Importing WordPress Database (Upload)
If you have moved a website to a new host and you are trying to upload the database that you have previously exported, then there is a simple process for that.
All you have to do is to access PHPMyAdmin and enter the database folder. Here, you will be able to see an option named, ‘Import’.
Click that option and you will be able to upload an SQL file. After uploading the file, you will scroll down to see a button named, ‘Go’.
Click the ‘Go’ button and your database file will be imported. It is a very simple process and you will be able to upload your database to your new website. However, you need to be sure that the database information is correct. Here is a complete guide to import database into a new host.
There are various reasons to access WordPress Database and you should know how to do it. If you are planning to migrate WordPress site to another host, then make sure to understand the process and follow all steps properly. However, when you are accessing a database of your website, make sure not to mess with anything as it can create problems for you. Stay tuned and keep posting your suggestions.