We have already presented an overview of MySQL and the various data types that it supports. By now you should have enough information to sketch out a table within a database holding the information that you want to store and their associated data types. Let’s continue the process of creating a database and a user with privilege to access the database.

Most hosting plans do not automatically include root access to your account. Therefore, we will be using cPanel tools to create the database and user.

Create a MySQL Database

  1. Log into cPanel and locate Databases.
  2. Click MySQL Databases.
  3. In the New Database field, type a name for the database.
  4. Click Create Database.
  5. Click Go Back and the new database should appear in the Current Databases table.
  6. Make a note of the name of the new database that you just created.

Create a Database User

  1. Log into cPanel and locate Databases.
  2. Click MySQL Databases.
  3. Click Jump to MySQL Users in the top-right corner of the page.
  4. Under Add New User, enter a username.
  5. Enter a password in the password field or click the Password Generator button.
  6. Retype the password in the Password (Again) field.
  7. Click Create User.
  8. Make a note of the name and password of the user that you just created.

Assign Privileges to Database User

  1. Log into cPanel and locate Databases.
  2. Click MySQL Databases.
  3. Under Add User to Database, select the user from the User drop-down menu.
  4. From the Database drop-down menu, select the database you wish to allow the user access to.
  5. Click Add.
  6. From the MySQL Account Maintenance screen, select the privileges you wish to grant the user or select ALL PRIVILEGES.
  7. Click Make Changes.

Add your IP to Remote MySQL

  1. Log into cPanel and locate Databases.
  2. Click Remote MySQL.
  3. Perform a google search for “What’s my IP
  4. Enter that number in the Host text box under the Add Access Host heading.
  5. Enter a comment that will be descriptive of the IP you are adding (e.g., home).
  6. Click Add Host.