How to create a MySQL database and user Print

  • 0

Many web apps store their content in a MySQL database. If you install apps with Softaculous, the database is created for you. If you upload your own site or install an app by hand, create one with the Database Wizard.

Create a database with the Database Wizard

  1. In cPanel, open Databases → Database Wizard.
  2. Step 1: type a name for the database (for example shop) and click Next Step.

Step 1 of the Database Wizard: naming the database

  1. Step 2: create a database user. Type a username, generate a strong password with the Password Generator and save it somewhere safe. Click Create User.

Step 2: creating a database user with a strong password

  1. Step 3: tick ALL PRIVILEGES so the user can fully use the database, then click Make Changes.

Step 3: giving the user all privileges on the database

Your connection details

Your app's configuration needs these four details:

Database nameyour cPanel username + _ + the name, e.g. username_shop
Database usere.g. username_shopuser
Passwordthe password from step 2
Hostlocalhost
Remember the prefix: cPanel always adds your username and an underscore to database and user names. Use the full names in your configuration file.

Managing databases

In Databases → Manage My Databases you can see all databases and their users, rename or delete them, change a user's password and add a user to a database.

The list of current databases and their users

Next: How to import or export a database with phpMyAdmin


Was this answer helpful?

« Back