The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to cCreate database and users

Discussion in 'Database Discussions' started by slolo, Feb 8, 2012.

  1. slolo

    slolo Registered

    Joined:
    Feb 8, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    How to create a new database and user

    Hello,

    This question has probably been discussed many times but I have found the answer nowhere.
    I am new with CentOS 5.7 and cPanel 11.30.5 (build 6)

    I have a VPS (with Santrex) which provided the OS CentOS with cPanel (included)
    All work perfectly.

    What I would like is very simple (normally).
    I just want to create a new database and a create a user in order to use it.
    My aim is to have a simple web site (in PHP) with a database.

    So, here is what I have done:
    - In WHM, I have created an new account with a domain and a username (like that I can use it for my Web site instead of root user)
    - I have created and tested successfully a small PHP page and it works

    Now, in WHM, I launch phpMyAdmin in order to create my database but there is no way to create a database.
    I can create a database with SQL script: CREATE DATABASE mydatabase
    But I cannot add user. When I click on the button "Add a user", nothing happen.

    To sum up, what is the way (best way) to create a database and add user in order to use in PHP.

    Also, what is exactly "Database Map Tool" and how does it work?

    Thanks in advance and have a nice day.

    ps: Sorry for my bad english.
     
    #1 slolo, Feb 8, 2012
    Last edited: Feb 8, 2012
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You said you created a new cPanel account in the WebHost Manager. That is the first step. Now you need to log into cPanel with the username and password for that account and create the database in cPanel.

    You cannot create a database or database user in the WHM or in phpMyAdmin. You must do it in cPanel. The reason for this is that if you could create a database or user in phpMyAdmin, or as root, then cPanel would have no way of tracking how many databases and users each account has. We force you to create and manage databases and users in cPanel for this reason.

    Please see the following documentation that explains how to manage databases and database users in cPanel:

    MySQL Databases

    If you have not yet logged into cPanel, please see the following documentation for an explanation of how to do so:

    Accessing cPanel

    Note that the URL is slightly different; cPanel listens on ports 2082 and 2083 instead of the WHM's 2086 and 2087.

    The database mapping tool allows the server administrator to manage users' ownership of databases. It is documented here:

    Database Map Tool

    However, at this point, you should not be concerned about database mapping. You need to log into cPanel and use the tools in cPanel to create a database and database user. You cannot do it in the WHM and we have disabled these functions in phpMyAdmin.
     
  3. slolo

    slolo Registered

    Joined:
    Feb 8, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you very much cPanelJared, you helped me a lot.

    In fact, I haven't noticed that for accessing cPanel, the URL was slightly different.

    Have a nice day.
     
Loading...

Share This Page