How to Setup and Manage Database for WordPress

Introduction

Setting up and managing your WordPress database is essential for any successful WordPress blog. It allows blogger to store wordpress data, blog post and optimize performance. In this article, i will show you on how to set up WordPress database in linux VPS server. We will cover steps such as creating a new database, create new user, grant permission.

Prerequisites

  • A server running CentOS or Oracle Linux
  • Root access and log in as the root user.

1. Login to VPS where you host the wordpress and login to MySQL database using root:

[root@linodelinux]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1234567
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

2. Create Database for your wordpress :
Example below will create database name “linodelinux“.

MariaDB [(none)]> create database linodelinux;

3. Create user for your WordPress Database :
Example below will create user “linodelinux” with preferred “password“.

MariaDB [(none)]> create user 'linodelinux'@'localhost' identified by 'secretpassword';

4. Setting permissions for your WordPress Database :

MariaDB [(none)]> grant all privileges on linodelinux.* to linodelinux@localhost;

Leave a Comment