BuycPanel Blog

BuycPanel Blog

Latest news and updates

Using MySQL Client to Create Users and Databases for WordPress

Posted by Alex on 23 02 2017.

MySQL is one of the best, open source communities of Relational Database Management System (RDBMS). It makes use of a Structured Query Language (SQL). It has gained popularity for its ease of adding, managing, and accessing database content. Then, there are also its other features, including its tried and tested reliability, ease of use, flexibility, and speedy processing. As a plus, you can get it for free.

You can also use MySQL client when you want to use WordPress as your content management system using your cPanel account. Here are the steps you need to follow:

Create a MySQL Database in Your cPanel First

Before you can get WordPress via this RDBMS, you first need to create a database for MySQL in your cPanel account. You can do this via the MySQL Databases menu you will find in your cPanel interface.

  1. Get into your cPanel account and locate the MySQL Databases menu found under the Databases section.
  2. Once you have the menu in front of you, look for the “Create New Database” option. Just put in the name you want for this database and then hit on the button labelled “Create Database.”
  3. Now that you have created a ready-to-use database, you need to maintain it through assigning the MySQL User with the right privileges. In creating a MySQL User, just look for the “MySQL Users” section, click on it, and then choose the option “Add New User.” Select the username you want to assign the database to, and make sure you create a powerful, hack-free password.
  4. Lastly, just click on the button labelled “Create User.”

Downloading WordPress to cPanel via MySQL Client

Since you now have all the prerequisites, you can now get WordPress for your cPanel. You can easily and speedily create databases and users of MySQL/MariaDB through shell execution of mysql.

To give you an idea on what to expect, check the example syntax below, wherein the dollar sign represents the command prompt:

  • $ mysql -u adminusername -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 5340 to server version: 3.23.54


Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.


mysql> CREATE DATABASE databasename;

Query OK, 1 row affected (0.00 sec)


mysql> GRANT ALL PRIVILEGES ON databasename.* TO “wordpressusername”@”hostname”

-> IDENTIFIED BY “password”;

Query OK, 0 rows affected (0.00 sec)



Query OK, 0 rows affected (0.01 sec)


mysql> EXIT



What All these Mean

In this sample syntax, it shows the following:

  • The root represents the adminusername. Many experts advice beginners to choose a “mortal” account as their mysql admin, in order to avoid having to execute the command “mysql” as system’s root user.
  • Two good examples for database names include “blog” or “wordpress.”
  • Make sure that you generate a password secure enough to make it extremely difficult to guess. Always make it a habit to create passwords that combine letters, numbers, and characters. Use the alphabet in both lower and upper case.

There you have it, as long as you follow these steps, you can have WordPress up and running through MySQL under your cPanel account.