How to Create and Manage MySQL WordPress Database Using WordPress phpMyAdmin

March 8, 2018 | Views: 3323

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

WordPress is the leading blogging platform. In the last decade or so, it has been adopted as a great platform for building dynamic websites. The reason for its increased popularity can be attributed to its huge community and user-friendly interface. One thing that most people don’t know is that this platform is PHP based and uses MySQL database as the backend database. This article takes a look at the steps you should take when creating your MySQL database manually for your website or blog.

How WordPress uses database

Before looking into the procedure of creating your first MySQL database, it is good to first understand how WordPress uses databases. To start with, you need to understand that WordPress uses the PHP programming language to store and retrieve data databases. The information stored in the database includes pages, posts, categories, comments, custom fields, tags, user data, and other website options like URLs.

When installing WordPress for the first time, you will be asked to provide your username, password, host and database name. The information you provide is stored in wp-config.php (configuration file). The information you provide is used to create your database tables as well as store the default installation information in the tables. After that, WordPress will run queries to the database in order to generate pages that are dynamic and in HTML. This is what has made WordPress a very powerful platform asthere is no need to keep creating new .html files for every page you want to add. Everything will be handled dynamically for you by WordPress. 

Managing your database with phpMyAdmin

phpMyAdmin is an open source software. It provides web based graphical user interface that makes it easy for you to manage MySQL database. Most hosting providers that support WordPress offer phpMyAdmin in the control panel. This makes it easy for you to access and manage your database.

To manage your database, you need to open phpMyAdmin and click on Databases. You will find a list of all the databases that have been created or that you have access to. Click your preferred database to view the database tables.

phpMyAdmin allows you to execute many tasks like finding or replacing words in posts, repairing the database, optimizing the database, adding an admin user, changing passwords, deactivating plugins and so on. You have to be careful before making any changes. Make a backup every time you wish to make changes in your database.

Creating a database backup with phpMyAdmin

Creating database backups with phpMyAdmin is pretty straightforward. Select the target database then click ‘Export’. In an updated version, you will be asked to select the export method you prefer. The default method will export your database into a .sql file. With the custom methods, you can download the backup in a compressed gzip archive or zip. Zip format is the best option. With the custom options, you can exclude tables when creating a backup. With this option, you can exclude a table that was created by a plugin.

The backup can be imported into the same database or another one. All you need is to use the ‘import’ tab on phpMyAdmin. To avoid dire mistakes, you can seek help from a web design company. They have more experience creating database backups and will ensure every aspect is covered.

Backing up using a plugin

Just because phpMyAdmin is installed does not mean you must use it when creating a database backup. You can also use other backup plugins. The problem with downloading your database is that you will not get all the files. This is because fairly important elements of your site, images, are not in the database. They are stored in the /wp-content/directory. Even if the database has the majority of your information, it will be somewhat useless if it doesn’t have accompanying images. This is where the use of plugins come in handy.

When it comes to a complete backup, you have to backup themes, plugins, and images. Most hosting companies don’t do this on a daily so you need to do it yourself using or install a plugin that automates the process. Some good plugins you can try are VaultPress and BackupBuddy.

Optimizing database with phpMyAdmin

After you use your database for some time, it will become fragmented. Memory overheads increase the overall size of your database as well as time taken in query execution. MySQL has a simple command that helps optimize the database. Open phpMyAdmin and click on your preferred WordPress database. You will get a list of your tables. Click on ‘Check All’ then go to ‘With Selected’ drop down and click ‘Optimize Table’.

This simple task will optimize your tables through defragmentation. At the end of this, you will notice an improvement in the performance of your website. WordPress will be able to run queries faster and the size of your database will be reduced.

Other things you can do with phpMyAdmin

phpMyAdmin enables you to do many things by changing the values in your database. However, it is imperative that you never change values without knowing exactly what you are doing. You must also create a backup of your database before making any changes. Other things you can do with phpMyAdmin include:

·         Resetting your WordPress password

 

·         Adding a new Admin user to the database through MySQL

 

·         Changing your WordPress username

 

·         Deactivating WordPress plugins

The database is what holds most of your website data. You have to tread carefully when making changes to it. The smallest mistake can cause major problems that can cause you to start from scratch. If you are not certain of what you are doing, it is highly recommended to leave the work to the professionals. You also need to brush up on your knowledge of WordPress database management every once in a while. You must also be careful when adding new users. The last thing you want is to add a user whose account will be used to compromise the security of your site. Other than that, installing and learning how to use phpMyAdmin is the best decision you can make.

Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterGoogle+LinkedInEmail
Ready to share your knowledge and expertise?
3 Comments
  1. there is another example; when i tried to post the comment the first time, it told me it was marked as spam, so i tried to post it again with the same result. then i posted a comment criticizing the site and it said that was spam too, so again i tried to re-post and again it told me it was spam. now, both of the last 2 are posted even though it told me it wasn’t posting either and with no obvious way to delete one. i apologize to the author of this article for this being done here, but I’ve posted in the correct pace several times and my threads were deleted or ignored every time

  2. this site is really terribly coded, especially for being a CompSci site. anyone viewing any 0pen article can see a few examples. we should be able to read articles without hiding elements or reading straight from the HTML because the background or foreground are interfering(both are the case in different places on this very page)

  3. this site is really terribly coded, especially for being a CompSci site. anyone viewing any op3n article can see a few examples. we should be able to read articles without hiding elements or reading straight from the HTML because the background or foreground are interfering(both are the case in different places on this very page)

Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel