March 8, 2018
How to Create and Manage MySQL WordPress Database Using WordPress phpMyAdmin
March 8, 2018
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.