+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Databases

How to Create a MySQL Database and Database User

Most website software, including WordPress and most custom PHP applications, needs a MySQL database to store its content. Creating one involves three steps: creating the database itself, creating a database user, and linking that user to the database with the right privileges. The exact screens differ depending on your control panel.

In cPanel

  1. Log in to cPanel and open MySQL Databases.
  2. Under Create New Database, enter a name and click Create Database.
  3. Scroll to MySQL Users, enter a username and password under Add New User, and click Create User.
  4. Scroll to Add User To Database, select the user and the database you just created, then click Add.
  5. On the privileges screen, tick ALL PRIVILEGES unless your application specifically requires a narrower set, then click Make Changes.

In DirectAdmin

  1. Log in to DirectAdmin and open MySQL Management.
  2. Click Create new Database.
  3. Enter a database name, a username, and a password. DirectAdmin creates the user and links it to the database in this same step.
  4. Click Create.

The Details Your Application Will Ask For

Once created, most applications need the following during setup:

  • Database Host: usually localhost
  • Database Name
  • Database Username
  • Database Password
Both cPanel and DirectAdmin usually prefix your database and username with your hosting account's username automatically (for example, yourusername_dbname). Copy the full prefixed name exactly as shown, since a small typo here is the most common cause of a "database connection failed" error during setup.

Databases